models

package
v0.23.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2024 License: AGPL-3.0 Imports: 58 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SubscriptionEntityUnknown   = iota
	SubscriptionEntityNamespace // Kept even though not used anymore since we don't want to manually change all ids
	SubscriptionEntityProject
	SubscriptionEntityTask
)
View Source
const APITokenPrefix = `tk_`
View Source
const ErrCodeAPITokenInvalid = 14001

ErrCodeAPITokenInvalid holds the unique world-error code of this error

View Source
const ErrCodeAttachmentDoesNotBelongToTask = 4020

ErrCodeAttachmentDoesNotBelongToTask holds the unique world-error code of this error

View Source
const ErrCodeBucketDoesNotBelongToProject = 10002

ErrCodeBucketDoesNotBelongToProject holds the unique world-error code of this error

View Source
const ErrCodeBucketDoesNotExist = 10001

ErrCodeBucketDoesNotExist holds the unique world-error code of this error

View Source
const ErrCodeBucketLimitExceeded = 10004

ErrCodeBucketLimitExceeded holds the unique world-error code of this error

View Source
const ErrCodeBulkTasksMustBeInSameProject = 4003

ErrCodeBulkTasksMustBeInSameProject holds the unique world-error code of this error

View Source
const ErrCodeBulkTasksNeedAtLeastOne = 4004

ErrCodeBulkTasksNeedAtLeastOne holds the unique world-error code of this error

View Source
const ErrCodeCannotArchiveDefaultProject = 3013

ErrCodeCannotArchiveDefaultProject holds the unique world-error code of this error

View Source
const ErrCodeCannotDeleteDefaultProject = 3012

ErrCodeCannotDeleteDefaultProject holds the unique world-error code of this error

View Source
const ErrCodeCannotDeleteLastTeamMember = 6006

ErrCodeCannotDeleteLastTeamMember holds the unique world-error code of this error

View Source
const ErrCodeCannotRemoveLastBucket = 10003

ErrCodeCannotRemoveLastBucket holds the unique world-error code of this error

View Source
const ErrCodeIDCannotBeZero = 2001

ErrCodeIDCannotBeZero holds the unique world-error code of this error

View Source
const ErrCodeInvalidAPITokenPermission = 14002

ErrCodeInvalidAPITokenPermission holds the unique world-error code of this error

View Source
const ErrCodeInvalidData = 2002

ErrCodeInvalidData holds the unique world-error code of this error

View Source
const ErrCodeInvalidRelationKind = 4007

ErrCodeInvalidRelationKind holds the unique world-error code of this error

View Source
const ErrCodeInvalidRight = 9001

ErrCodeInvalidRight holds the unique world-error code of this error

View Source
const ErrCodeInvalidSortOrder = 4014

ErrCodeInvalidSortOrder holds the unique world-error code of this error

View Source
const ErrCodeInvalidSortParam = 4013

ErrCodeInvalidSortParam holds the unique world-error code of this error

View Source
const ErrCodeInvalidTaskField = 4016

ErrCodeInvalidTaskField holds the unique world-error code of this error

View Source
const ErrCodeInvalidTaskFilterComparator = 4017

ErrCodeInvalidTaskFilterComparator holds the unique world-error code of this error

View Source
const ErrCodeInvalidTaskFilterConcatinator = 4018

ErrCodeInvalidTaskFilterConcatinator holds the unique world-error code of this error

View Source
const ErrCodeInvalidTaskFilterValue = 4019

ErrCodeInvalidTaskFilterValue holds the unique world-error code of this error

View Source
const ErrCodeLabelDoesNotExist = 8002

ErrCodeLabelDoesNotExist holds the unique world-error code of this error

View Source
const ErrCodeLabelIsAlreadyOnTask = 8001

ErrCodeLabelIsAlreadyOnTask holds the unique world-error code of this error

View Source
const ErrCodeLinkSharePasswordInvalid = 13002

ErrCodeLinkSharePasswordInvalid holds the unique world-error code of this error

View Source
const ErrCodeLinkSharePasswordRequired = 13001

ErrCodeLinkSharePasswordRequired holds the unique world-error code of this error

View Source
const ErrCodeLinkShareTokenInvalid = 13003

ErrCodeLinkShareTokenInvalid holds the unique world-error code of this error

View Source
const ErrCodeNeedToHaveProjectReadAccess = 3004

ErrCodeNeedToHaveProjectReadAccess holds the unique world-error code of this error

View Source
const ErrCodeNoRightToSeeTask = 4005

ErrCodeNoRightToSeeTask holds the unique world-error code of this error

View Source
const ErrCodeOnlyOneDoneBucketPerProject = 10005

ErrCodeOnlyOneDoneBucketPerProject holds the unique world-error code of this error

View Source
const ErrCodeParentTaskCannotBeTheSame = 4006

ErrCodeParentTaskCannotBeTheSame holds the unique world-error code of this error

View Source
const ErrCodeProjectCannotBeChildOfItself = 3010

ErrCodeProjectCannotBeChildOfItself holds the unique world-error code of this error

View Source
const ErrCodeProjectCannotBelongToAPseudoParentProject = 3009

ErrCodeProjectCannotBelongToAPseudoParentProject holds the unique world-error code of this error

View Source
const ErrCodeProjectCannotHaveACyclicRelationship = 3011

ErrCodeProjectCannotHaveACyclicRelationship holds the unique world-error code of this error

View Source
const ErrCodeProjectDoesNotExist = 3001

ErrCodeProjectDoesNotExist holds the unique world-error code of this error

View Source
const ErrCodeProjectIdentifierIsNotUnique = 3007

ErrCodeProjectIdentifierIsNotUnique holds the unique world-error code of this error

View Source
const ErrCodeProjectIsArchived = 3008

ErrCodeProjectIsArchived holds the unique world-error code of this error

View Source
const ErrCodeProjectShareDoesNotExist = 3006

ErrCodeProjectShareDoesNotExist holds the unique world-error code of this error

View Source
const ErrCodeProjectTitleCannotBeEmpty = 3005

ErrCodeProjectTitleCannotBeEmpty holds the unique world-error code of this error

View Source
const ErrCodeRelationAlreadyExists = 4008

ErrCodeRelationAlreadyExists holds the unique world-error code of this error

View Source
const ErrCodeRelationDoesNotExist = 4009

ErrCodeRelationDoesNotExist holds the unique world-error code of this error

View Source
const ErrCodeRelationTasksCannotBeTheSame = 4010

ErrCodeRelationTasksCannotBeTheSame holds the unique world-error code of this error

View Source
const ErrCodeReminderRelativeToMissing = 4022

ErrCodeRelationDoesNotExist holds the unique world-error code of this error

View Source
const ErrCodeSavedFilterDoesNotExist = 11001

ErrCodeSavedFilterDoesNotExist holds the unique world-error code of this error

View Source
const ErrCodeSavedFilterNotAvailableForLinkShare = 11002

ErrCodeSavedFilterNotAvailableForLinkShare holds the unique world-error code of this error

View Source
const ErrCodeSubscriptionAlreadyExists = 12002

ErrCodeSubscriptionAlreadyExists holds the unique world-error code of this error

View Source
const ErrCodeTaskAttachmentDoesNotExist = 4011

ErrCodeTaskAttachmentDoesNotExist holds the unique world-error code of this error

View Source
const ErrCodeTaskAttachmentIsTooLarge = 4012

ErrCodeTaskAttachmentIsTooLarge holds the unique world-error code of this error

View Source
const ErrCodeTaskCannotBeEmpty = 4001

ErrCodeTaskCannotBeEmpty holds the unique world-error code of this error

View Source
const ErrCodeTaskCommentDoesNotExist = 4015

ErrCodeTaskCommentDoesNotExist holds the unique world-error code of this error

View Source
const ErrCodeTaskDoesNotExist = 4002

ErrCodeTaskDoesNotExist holds the unique world-error code of this error

View Source
const ErrCodeTaskRelationCycle = 4022

ErrCodeTaskRelationCycle holds the unique world-error code of this error

View Source
const ErrCodeTeamAlreadyHasAccess = 6004

ErrCodeTeamAlreadyHasAccess holds the unique world-error code of this error

View Source
const ErrCodeTeamDoesNotExist = 6002

ErrCodeTeamDoesNotExist holds the unique world-error code of this error

View Source
const ErrCodeTeamDoesNotHaveAccessToProject = 6007

ErrCodeTeamDoesNotHaveAccessToProject holds the unique world-error code of this error

View Source
const ErrCodeTeamNameCannotBeEmpty = 6001

ErrCodeTeamNameCannotBeEmpty holds the unique world-error code of this error

View Source
const ErrCodeUnknownSubscriptionEntityType = 12001

ErrCodeUnknownSubscriptionEntityType holds the unique world-error code of this error

View Source
const ErrCodeUserAlreadyAssigned = 4021

ErrCodeUserAlreadyAssigned holds the unique world-error code of this error

View Source
const ErrCodeUserAlreadyHasAccess = 7002

ErrCodeUserAlreadyHasAccess holds the unique world-error code of this error

View Source
const ErrCodeUserDoesNotHaveAccessToProject = 7003

ErrCodeUserDoesNotHaveAccessToProject holds the unique world-error code of this error

View Source
const ErrCodeUserHasNoAccessToLabel = 8003

ErrCodeUserHasNoAccessToLabel holds the unique world-error code of this error

View Source
const ErrCodeUserIsMemberOfTeam = 6005

ErrCodeUserIsMemberOfTeam holds the unique world-error code of this error

View Source
const ErrorCodeGenericForbidden = 0001

ErrorCodeGenericForbidden holds the unique world-error code of this error

View Source
const ProjectBackgroundUpload string = "upload"

ProjectBackgroundUpload represents the project upload background type

View Source
const (
	RightUnknown = -1
)

define unknown right

Variables

View Source
var FavoritesPseudoProject = Project{
	ID:          -1,
	Title:       "Favorites",
	Description: "This project has all tasks marked as favorites.",
	IsFavorite:  true,
	Position:    -1,
	Created:     time.Now(),
	Updated:     time.Now(),
}

FavoritesPseudoProject holds all tasks marked as favorites

Functions

func CanDoAPIRoute added in v0.22.0

func CanDoAPIRoute(c echo.Context, token *APIToken) (can bool)

CanDoAPIRoute checks if a token is allowed to use the current api route

func CollectRoutesForAPITokenUsage added in v0.22.0

func CollectRoutesForAPITokenUsage(route echo.Route)

CollectRoutesForAPITokenUsage gets called for every added APITokenRoute and builds a list of all routes we can use for the api tokens.

func CreateNewProjectForUser added in v0.21.0

func CreateNewProjectForUser(s *xorm.Session, u *user.User) (err error)

CreateNewProjectForUser creates a new inbox project for a user. To prevent import cycles, we can't do that directly in the user.Create function.

func CreateProject added in v0.21.0

func CreateProject(s *xorm.Session, project *Project, auth web.Auth, createBacklogBucket bool) (err error)

func CreateTypesenseCollections added in v0.22.0

func CreateTypesenseCollections() error

func DeleteUser added in v0.18.0

func DeleteUser(s *xorm.Session, u *user.User) (err error)

DeleteUser completely removes a user and all their associated projects and tasks. This action is irrevocable. Public to allow deletion from the CLI.

func ExportUserData added in v0.18.0

func ExportUserData(s *xorm.Session, u *user.User) (err error)

func FindMentionedUsersInText added in v0.18.0

func FindMentionedUsersInText(s *xorm.Session, text string) (users map[int64]*user.User, err error)

func GetAvailableAPIRoutesForToken added in v0.22.0

func GetAvailableAPIRoutesForToken(c echo.Context) error

GetAvailableAPIRoutesForToken returns a list of all API routes which are available for token usage. @Summary Get a list of all token api routes @Description Returns a list of all API routes which are available to use with an api token, not a user login. @tags api @Produce json @Security JWTKeyAuth @Success 200 {array} models.APITokenRoute "The list of all routes." @Router /routes [get]

func GetAvailableWebhookEvents added in v0.22.0

func GetAvailableWebhookEvents() []string

func GetLinkSharesByIDs added in v0.17.0

func GetLinkSharesByIDs(s *xorm.Session, ids []int64) (shares map[int64]*LinkSharing, err error)

GetLinkSharesByIDs returns all link shares from a slice of ids

func GetProjectsByIDs added in v0.21.0

func GetProjectsByIDs(s *xorm.Session, projectIDs []int64) (projects map[int64]*Project, err error)

GetProjectsByIDs returns a map of projects from a slice with project ids

func GetProjectsSimplByTaskIDs added in v0.22.0

func GetProjectsSimplByTaskIDs(s *xorm.Session, taskIDs []int64) (ps map[int64]*Project, err error)

GetProjectsSimplByTaskIDs gets a list of projects by a task ids

func GetSubscriptions added in v0.20.0

func GetSubscriptions(s *xorm.Session, entityType SubscriptionEntityType, entityIDs []int64, a web.Auth) (projectsToSubscriptions map[int64][]*Subscription, err error)

GetSubscriptions returns a map of subscriptions to a set of given entity IDs

func GetTables

func GetTables() []interface{}

GetTables returns all structs which are also a table.

func GetTotalCount

func GetTotalCount(counting interface{}) (count int64, err error)

GetTotalCount returns the total amount of something

func GetUserOrLinkShareUser added in v0.17.0

func GetUserOrLinkShareUser(s *xorm.Session, a web.Auth) (uu *user.User, err error)

GetUserOrLinkShareUser returns either a user or a link share disguised as a user.

func HashToken added in v0.22.0

func HashToken(token, salt string) string

func InitTypesense added in v0.22.0

func InitTypesense()

func InvalidFieldError added in v0.22.0

func InvalidFieldError(fields []string) error

func IsErrAPITokenInvalid added in v0.22.0

func IsErrAPITokenInvalid(err error) bool

IsErrAPITokenInvalid checks if an error is ErrAPITokenInvalid.

func IsErrAttachmentAndCoverMustBelongToTheSameTask added in v0.20.0

func IsErrAttachmentAndCoverMustBelongToTheSameTask(err error) bool

IsErrAttachmentAndCoverMustBelongToTheSameTask checks if an error is ErrAttachmentDoesNotBelongToTask.

func IsErrBucketDoesNotBelongToProject added in v0.21.0

func IsErrBucketDoesNotBelongToProject(err error) bool

IsErrBucketDoesNotBelongToProject checks if an error is ErrBucketDoesNotBelongToProject.

func IsErrBucketDoesNotExist

func IsErrBucketDoesNotExist(err error) bool

IsErrBucketDoesNotExist checks if an error is ErrBucketDoesNotExist.

func IsErrBucketLimitExceeded added in v0.15.0

func IsErrBucketLimitExceeded(err error) bool

IsErrBucketLimitExceeded checks if an error is ErrBucketLimitExceeded.

func IsErrBulkTasksMustBeInSameProject added in v0.21.0

func IsErrBulkTasksMustBeInSameProject(err error) bool

IsErrBulkTasksMustBeInSameProject checks if an error is a ErrBulkTasksMustBeInSameProject.

func IsErrBulkTasksNeedAtLeastOne

func IsErrBulkTasksNeedAtLeastOne(err error) bool

IsErrBulkTasksNeedAtLeastOne checks if an error is a ErrBulkTasksNeedAtLeastOne.

func IsErrCannotArchiveDefaultProject added in v0.21.0

func IsErrCannotArchiveDefaultProject(err error) bool

IsErrCannotArchiveDefaultProject checks if an error is a project is archived error.

func IsErrCannotDeleteDefaultProject added in v0.21.0

func IsErrCannotDeleteDefaultProject(err error) bool

IsErrCannotDeleteDefaultProject checks if an error is a project is archived error.

func IsErrCannotDeleteLastTeamMember

func IsErrCannotDeleteLastTeamMember(err error) bool

IsErrCannotDeleteLastTeamMember checks if an error is ErrCannotDeleteLastTeamMember.

func IsErrCannotRemoveLastBucket

func IsErrCannotRemoveLastBucket(err error) bool

IsErrCannotRemoveLastBucket checks if an error is ErrCannotRemoveLastBucket.

func IsErrGenericForbidden

func IsErrGenericForbidden(err error) bool

IsErrGenericForbidden checks if an error is a ErrGenericForbidden.

func IsErrIDCannotBeZero

func IsErrIDCannotBeZero(err error) bool

IsErrIDCannotBeZero checks if an error is a ErrIDCannotBeZero.

func IsErrInvalidAPITokenPermission added in v0.22.0

func IsErrInvalidAPITokenPermission(err error) bool

IsErrInvalidAPITokenPermission checks if an error is ErrInvalidAPITokenPermission.

func IsErrInvalidData

func IsErrInvalidData(err error) bool

IsErrInvalidData checks if an error is a ErrIDCannotBeZero.

func IsErrInvalidRelationKind

func IsErrInvalidRelationKind(err error) bool

IsErrInvalidRelationKind checks if an error is ErrInvalidRelationKind.

func IsErrInvalidRight

func IsErrInvalidRight(err error) bool

IsErrInvalidRight checks if an error is ErrInvalidRight.

func IsErrInvalidSortOrder

func IsErrInvalidSortOrder(err error) bool

IsErrInvalidSortOrder checks if an error is ErrInvalidSortOrder.

func IsErrInvalidSortParam

func IsErrInvalidSortParam(err error) bool

IsErrInvalidSortParam checks if an error is ErrInvalidSortParam.

func IsErrInvalidTaskField

func IsErrInvalidTaskField(err error) bool

IsErrInvalidTaskField checks if an error is ErrInvalidTaskField.

func IsErrInvalidTaskFilterComparator

func IsErrInvalidTaskFilterComparator(err error) bool

IsErrInvalidTaskFilterComparator checks if an error is ErrInvalidTaskFilterComparator.

func IsErrInvalidTaskFilterConcatinator

func IsErrInvalidTaskFilterConcatinator(err error) bool

IsErrInvalidTaskFilterConcatinator checks if an error is ErrInvalidTaskFilterConcatinator.

func IsErrInvalidTaskFilterValue added in v0.14.0

func IsErrInvalidTaskFilterValue(err error) bool

IsErrInvalidTaskFilterValue checks if an error is ErrInvalidTaskFilterValue.

func IsErrLabelDoesNotExist

func IsErrLabelDoesNotExist(err error) bool

IsErrLabelDoesNotExist checks if an error is ErrLabelDoesNotExist.

func IsErrLabelIsAlreadyOnTask

func IsErrLabelIsAlreadyOnTask(err error) bool

IsErrLabelIsAlreadyOnTask checks if an error is ErrLabelIsAlreadyOnTask.

func IsErrLinkSharePasswordInvalid added in v0.17.0

func IsErrLinkSharePasswordInvalid(err error) bool

IsErrLinkSharePasswordInvalid checks if an error is ErrLinkSharePasswordInvalid.

func IsErrLinkSharePasswordRequired added in v0.17.0

func IsErrLinkSharePasswordRequired(err error) bool

IsErrLinkSharePasswordRequired checks if an error is ErrLinkSharePasswordRequired.

func IsErrLinkShareTokenInvalid added in v0.21.0

func IsErrLinkShareTokenInvalid(err error) bool

IsErrLinkShareTokenInvalid checks if an error is ErrLinkShareTokenInvalid.

func IsErrNeedToHaveProjectReadAccess added in v0.21.0

func IsErrNeedToHaveProjectReadAccess(err error) bool

IsErrNeedToHaveProjectReadAccess checks if an error is a ErrProjectDoesNotExist.

func IsErrNoRightToSeeTask

func IsErrNoRightToSeeTask(err error) bool

IsErrNoRightToSeeTask checks if an error is ErrNoRightToSeeTask.

func IsErrOnlyOneDoneBucketPerProject added in v0.21.0

func IsErrOnlyOneDoneBucketPerProject(err error) bool

IsErrOnlyOneDoneBucketPerProject checks if an error is ErrBucketLimitExceeded.

func IsErrParentTaskCannotBeTheSame

func IsErrParentTaskCannotBeTheSame(err error) bool

IsErrParentTaskCannotBeTheSame checks if an error is ErrParentTaskCannotBeTheSame.

func IsErrProjectCannotBeChildOfItsOwn added in v0.21.0

func IsErrProjectCannotBeChildOfItsOwn(err error) bool

IsErrProjectCannotBeChildOfItsOwn checks if an error is a project is archived error.

func IsErrProjectCannotBelongToAPseudoParentProject added in v0.21.0

func IsErrProjectCannotBelongToAPseudoParentProject(err error) bool

IsErrProjectCannotBelongToAPseudoParentProject checks if an error is a project is archived error.

func IsErrProjectCannotHaveACyclicRelationship added in v0.21.0

func IsErrProjectCannotHaveACyclicRelationship(err error) bool

IsErrProjectCannotHaveACyclicRelationship checks if an error is a project is archived error.

func IsErrProjectDoesNotExist added in v0.21.0

func IsErrProjectDoesNotExist(err error) bool

IsErrProjectDoesNotExist checks if an error is a ErrProjectDoesNotExist.

func IsErrProjectIdentifierIsNotUnique added in v0.21.0

func IsErrProjectIdentifierIsNotUnique(err error) bool

IsErrProjectIdentifierIsNotUnique checks if an error is a ErrProjectIdentifierIsNotUnique.

func IsErrProjectIsArchived added in v0.21.0

func IsErrProjectIsArchived(err error) bool

IsErrProjectIsArchived checks if an error is a project is archived error.

func IsErrProjectShareDoesNotExist added in v0.21.0

func IsErrProjectShareDoesNotExist(err error) bool

IsErrProjectShareDoesNotExist checks if an error is a ErrProjectShareDoesNotExist.

func IsErrProjectTitleCannotBeEmpty added in v0.21.0

func IsErrProjectTitleCannotBeEmpty(err error) bool

IsErrProjectTitleCannotBeEmpty checks if an error is a ErrProjectTitleCannotBeEmpty.

func IsErrRelationAlreadyExists

func IsErrRelationAlreadyExists(err error) bool

IsErrRelationAlreadyExists checks if an error is ErrRelationAlreadyExists.

func IsErrRelationDoesNotExist

func IsErrRelationDoesNotExist(err error) bool

IsErrRelationDoesNotExist checks if an error is ErrRelationDoesNotExist.

func IsErrRelationTasksCannotBeTheSame

func IsErrRelationTasksCannotBeTheSame(err error) bool

IsErrRelationTasksCannotBeTheSame checks if an error is ErrRelationTasksCannotBeTheSame.

func IsErrReminderRelativeToMissing added in v0.21.0

func IsErrReminderRelativeToMissing(err error) bool

IsErrReminderRelativeToMissing checks if an error is ErrReminderRelativeToMissing.

func IsErrSavedFilterDoesNotExist added in v0.15.0

func IsErrSavedFilterDoesNotExist(err error) bool

IsErrSavedFilterDoesNotExist checks if an error is ErrSavedFilterDoesNotExist.

func IsErrSavedFilterNotAvailableForLinkShare added in v0.15.0

func IsErrSavedFilterNotAvailableForLinkShare(err error) bool

IsErrSavedFilterNotAvailableForLinkShare checks if an error is ErrSavedFilterNotAvailableForLinkShare.

func IsErrSubscriptionAlreadyExists added in v0.17.0

func IsErrSubscriptionAlreadyExists(err error) bool

IsErrSubscriptionAlreadyExists checks if an error is ErrSubscriptionAlreadyExists.

func IsErrTaskAttachmentDoesNotExist

func IsErrTaskAttachmentDoesNotExist(err error) bool

IsErrTaskAttachmentDoesNotExist checks if an error is ErrTaskAttachmentDoesNotExist.

func IsErrTaskAttachmentIsTooLarge

func IsErrTaskAttachmentIsTooLarge(err error) bool

IsErrTaskAttachmentIsTooLarge checks if an error is ErrTaskAttachmentIsTooLarge.

func IsErrTaskCannotBeEmpty

func IsErrTaskCannotBeEmpty(err error) bool

IsErrTaskCannotBeEmpty checks if an error is a ErrProjectDoesNotExist.

func IsErrTaskCommentDoesNotExist

func IsErrTaskCommentDoesNotExist(err error) bool

IsErrTaskCommentDoesNotExist checks if an error is ErrTaskCommentDoesNotExist.

func IsErrTaskDoesNotExist

func IsErrTaskDoesNotExist(err error) bool

IsErrTaskDoesNotExist checks if an error is a ErrProjectDoesNotExist.

func IsErrTaskRelationCycle added in v0.23.0

func IsErrTaskRelationCycle(err error) bool

IsErrTaskRelationCycle checks if an error is ErrTaskRelationCycle.

func IsErrTeamAlreadyHasAccess

func IsErrTeamAlreadyHasAccess(err error) bool

IsErrTeamAlreadyHasAccess checks if an error is ErrTeamAlreadyHasAccess.

func IsErrTeamDoesNotExist

func IsErrTeamDoesNotExist(err error) bool

IsErrTeamDoesNotExist checks if an error is ErrTeamDoesNotExist.

func IsErrTeamDoesNotHaveAccessToProject added in v0.21.0

func IsErrTeamDoesNotHaveAccessToProject(err error) bool

IsErrTeamDoesNotHaveAccessToProject checks if an error is a ErrProjectDoesNotExist.

func IsErrTeamNameCannotBeEmpty

func IsErrTeamNameCannotBeEmpty(err error) bool

IsErrTeamNameCannotBeEmpty checks if an error is a ErrTeamNameCannotBeEmpty.

func IsErrUnknownSubscriptionEntityType added in v0.17.0

func IsErrUnknownSubscriptionEntityType(err error) bool

IsErrUnknownSubscriptionEntityType checks if an error is ErrUnknownSubscriptionEntityType.

func IsErrUserAlreadyAssigned added in v0.20.0

func IsErrUserAlreadyAssigned(err error) bool

IsErrUserAlreadyAssigned checks if an error is ErrUserAlreadyAssigned.

func IsErrUserAlreadyHasAccess

func IsErrUserAlreadyHasAccess(err error) bool

IsErrUserAlreadyHasAccess checks if an error is ErrUserAlreadyHasAccess.

func IsErrUserDoesNotHaveAccessToProject added in v0.21.0

func IsErrUserDoesNotHaveAccessToProject(err error) bool

IsErrUserDoesNotHaveAccessToProject checks if an error is a ErrProjectDoesNotExist.

func IsErrUserHasNoAccessToLabel

func IsErrUserHasNoAccessToLabel(err error) bool

IsErrUserHasNoAccessToLabel checks if an error is ErrUserHasNoAccessToLabel.

func IsErrUserIsMemberOfTeam

func IsErrUserIsMemberOfTeam(err error) bool

IsErrUserIsMemberOfTeam checks if an error is ErrUserIsMemberOfTeam.

func ListUsersFromProject added in v0.21.0

func ListUsersFromProject(s *xorm.Session, l *Project, search string) (users []*user.User, err error)

ListUsersFromProject returns a list with all users who have access to a project, regardless of the method which gave them access

func PermissionsAreValid added in v0.22.0

func PermissionsAreValid(permissions APIPermissions) (err error)

func RegisterEventForWebhook added in v0.22.0

func RegisterEventForWebhook(event events.Event)

func RegisterListeners added in v0.17.0

func RegisterListeners()

RegisterListeners registers all event listeners

func RegisterOldExportCleanupCron added in v0.18.0

func RegisterOldExportCleanupCron()

func RegisterOverdueReminderCron added in v0.17.0

func RegisterOverdueReminderCron()

RegisterOverdueReminderCron registers a function which checks once a day for tasks that are overdue and not done.

func RegisterReminderCron added in v0.16.0

func RegisterReminderCron()

RegisterReminderCron registers a cron function which runs every minute to check if any reminders are due the next minute to send emails.

func RegisterUserDeletionCron added in v0.18.0

func RegisterUserDeletionCron()

RegisterUserDeletionCron registers the cron job that actually removes users who are scheduled to delete.

func ReindexAllTasks added in v0.22.0

func ReindexAllTasks() (err error)

func RemoveUnsplashPhoto added in v0.14.0

func RemoveUnsplashPhoto(s *xorm.Session, fileID int64) (err error)

RemoveUnsplashPhoto removes an unsplash photo from the db

func SetEngine

func SetEngine() (err error)

SetEngine sets the xorm.Engine

func SetProjectBackground added in v0.21.0

func SetProjectBackground(s *xorm.Session, projectID int64, background *files.File, blurHash string) (err error)

SetProjectBackground sets a background file as project background in the db

func SetupTests

func SetupTests()

SetupTests takes care of seting up the db, fixtures etc. This is an extra function to be able to call the fixtures setup from the integration tests.

func SyncUpdatedTasksIntoTypesense added in v0.22.0

func SyncUpdatedTasksIntoTypesense() (err error)

func UpdateProject added in v0.21.0

func UpdateProject(s *xorm.Session, project *Project, auth web.Auth, updateProjectBackground bool) (err error)

func VerifyLinkSharePassword added in v0.17.0

func VerifyLinkSharePassword(share *LinkSharing, password string) (err error)

VerifyLinkSharePassword checks if a password of a link share matches a provided one.

Types

type APIPermissions added in v0.22.0

type APIPermissions map[string][]string

type APIToken added in v0.22.0

type APIToken struct {
	// The unique, numeric id of this api key.
	ID int64 `xorm:"bigint autoincr not null unique pk" json:"id" param:"token"`

	// A human-readable name for this token
	Title string `xorm:"not null" json:"title" valid:"required"`
	// The actual api key. Only visible after creation.
	Token          string `xorm:"-" json:"token,omitempty"`
	TokenSalt      string `xorm:"not null" json:"-"`
	TokenHash      string `xorm:"not null unique" json:"-"`
	TokenLastEight string `xorm:"not null index varchar(8)" json:"-"`
	// The permissions this token has. Possible values are available via the /routes endpoint and consist of the keys of the list from that endpoint. For example, if the token should be able to read all tasks as well as update existing tasks, you should add `{"tasks":["read_all","update"]}`.
	Permissions APIPermissions `xorm:"json not null" json:"permissions" valid:"required"`
	// The date when this key expires.
	ExpiresAt time.Time `xorm:"not null" json:"expires_at" valid:"required"`

	// A timestamp when this api key was created. You cannot change this value.
	Created time.Time `xorm:"created not null" json:"created"`

	OwnerID int64 `xorm:"bigint not null" json:"-"`

	web.Rights   `xorm:"-" json:"-"`
	web.CRUDable `xorm:"-" json:"-"`
}

func GetAPITokenByID added in v0.22.0

func GetAPITokenByID(s *xorm.Session, id int64) (token *APIToken, err error)

func GetTokenFromTokenString added in v0.22.0

func GetTokenFromTokenString(s *xorm.Session, token string) (apiToken *APIToken, err error)

GetTokenFromTokenString returns the full token object from the original token string.

func (*APIToken) CanCreate added in v0.22.0

func (t *APIToken) CanCreate(_ *xorm.Session, _ web.Auth) (bool, error)

func (*APIToken) CanDelete added in v0.22.0

func (t *APIToken) CanDelete(s *xorm.Session, a web.Auth) (bool, error)

func (*APIToken) Create added in v0.22.0

func (t *APIToken) Create(s *xorm.Session, a web.Auth) (err error)

Create creates a new token @Summary Create a new api token @Description Create a new api token to use on behalf of the user creating it. @tags api @Accept json @Produce json @Security JWTKeyAuth @Param token body models.APIToken true "The token object with required fields" @Success 200 {object} models.APIToken "The created token." @Failure 400 {object} web.HTTPError "Invalid token object provided." @Failure 500 {object} models.Message "Internal error" @Router /tokens [put]

func (*APIToken) Delete added in v0.22.0

func (t *APIToken) Delete(s *xorm.Session, a web.Auth) (err error)

Delete deletes a token @Summary Deletes an existing api token @Description Delete any of the user's api tokens. @tags api @Accept json @Produce json @Security JWTKeyAuth @Param tokenID path int true "Token ID" @Success 200 {object} models.Message "Successfully deleted." @Failure 404 {object} web.HTTPError "The token does not exist." @Failure 500 {object} models.Message "Internal error" @Router /tokens/{tokenID} [delete]

func (*APIToken) ReadAll added in v0.22.0

func (t *APIToken) ReadAll(s *xorm.Session, a web.Auth, search string, page int, perPage int) (result interface{}, resultCount int, numberOfTotalItems int64, err error)

ReadAll returns all api tokens the current user has created @Summary Get all api tokens of the current user @Description Returns all api tokens the current user has created. @tags api @Accept json @Produce json @Security JWTKeyAuth @Param page query int false "The page number, used for pagination. If not provided, the first page of results is returned." @Param per_page query int false "The maximum number of tokens per page. This parameter is limited by the configured maximum of items per page." @Param s query string false "Search tokens by their title." @Success 200 {array} models.APIToken "The list of all tokens" @Failure 500 {object} models.Message "Internal server error" @Router /tokens [get]

func (*APIToken) TableName added in v0.22.0

func (*APIToken) TableName() string

type APITokenRoute added in v0.22.0

type APITokenRoute struct {
	Create  *RouteDetail `json:"create,omitempty"`
	ReadOne *RouteDetail `json:"read_one,omitempty"`
	ReadAll *RouteDetail `json:"read_all,omitempty"`
	Update  *RouteDetail `json:"update,omitempty"`
	Delete  *RouteDetail `json:"delete,omitempty"`
}

type AddTaskToTypesense added in v0.22.0

type AddTaskToTypesense struct {
}

AddTaskToTypesense represents a listener

func (*AddTaskToTypesense) Handle added in v0.22.0

func (l *AddTaskToTypesense) Handle(msg *message.Message) (err error)

Handle is executed when the event AddTaskToTypesense listens on is fired

func (*AddTaskToTypesense) Name added in v0.22.0

func (l *AddTaskToTypesense) Name() string

Name defines the name for the AddTaskToTypesense listener

type Bucket

type Bucket struct {
	// The unique, numeric id of this bucket.
	ID int64 `xorm:"bigint autoincr not null unique pk" json:"id" param:"bucket"`
	// The title of this bucket.
	Title string `xorm:"text not null" valid:"required" minLength:"1" json:"title"`
	// The project this bucket belongs to.
	ProjectID int64 `xorm:"bigint not null" json:"project_id" param:"project"`
	// All tasks which belong to this bucket.
	Tasks []*Task `xorm:"-" json:"tasks"`

	// How many tasks can be at the same time on this board max
	Limit int64 `xorm:"default 0" json:"limit" minimum:"0" valid:"range(0|9223372036854775807)"`

	// The number of tasks currently in this bucket
	Count int64 `xorm:"-" json:"count"`

	// The position this bucket has when querying all buckets. See the tasks.position property on how to use this.
	Position float64 `xorm:"double null" json:"position"`

	// A timestamp when this bucket was created. You cannot change this value.
	Created time.Time `xorm:"created not null" json:"created"`
	// A timestamp when this bucket was last updated. You cannot change this value.
	Updated time.Time `xorm:"updated not null" json:"updated"`

	// The user who initially created the bucket.
	CreatedBy   *user.User `xorm:"-" json:"created_by" valid:"-"`
	CreatedByID int64      `xorm:"bigint not null" json:"-"`

	// Including the task collection type so we can use task filters on kanban
	TaskCollection `xorm:"-" json:"-"`

	web.Rights   `xorm:"-" json:"-"`
	web.CRUDable `xorm:"-" json:"-"`
}

Bucket represents a kanban bucket

func (*Bucket) CanCreate

func (b *Bucket) CanCreate(s *xorm.Session, a web.Auth) (bool, error)

CanCreate checks if a user can create a new bucket

func (*Bucket) CanDelete

func (b *Bucket) CanDelete(s *xorm.Session, a web.Auth) (bool, error)

CanDelete checks if a user can delete an existing bucket

func (*Bucket) CanUpdate

func (b *Bucket) CanUpdate(s *xorm.Session, a web.Auth) (bool, error)

CanUpdate checks if a user can update an existing bucket

func (*Bucket) Create

func (b *Bucket) Create(s *xorm.Session, a web.Auth) (err error)

Create creates a new bucket @Summary Create a new bucket @Description Creates a new kanban bucket on a project. @tags project @Accept json @Produce json @Security JWTKeyAuth @Param id path int true "Project Id" @Param bucket body models.Bucket true "The bucket object" @Success 200 {object} models.Bucket "The created bucket object." @Failure 400 {object} web.HTTPError "Invalid bucket object provided." @Failure 404 {object} web.HTTPError "The project does not exist." @Failure 500 {object} models.Message "Internal error" @Router /projects/{id}/buckets [put]

func (*Bucket) Delete

func (b *Bucket) Delete(s *xorm.Session, _ web.Auth) (err error)

Delete removes a bucket, but no tasks @Summary Deletes an existing bucket @Description Deletes an existing kanban bucket and dissociates all of its task. It does not delete any tasks. You cannot delete the last bucket on a project. @tags project @Accept json @Produce json @Security JWTKeyAuth @Param projectID path int true "Project Id" @Param bucketID path int true "Bucket Id" @Success 200 {object} models.Message "Successfully deleted." @Failure 404 {object} web.HTTPError "The bucket does not exist." @Failure 500 {object} models.Message "Internal error" @Router /projects/{projectID}/buckets/{bucketID} [delete]

func (*Bucket) ReadAll

func (b *Bucket) ReadAll(s *xorm.Session, auth web.Auth, search string, page int, perPage int) (result interface{}, resultCount int, numberOfTotalItems int64, err error)

ReadAll returns all buckets with their tasks for a certain project @Summary Get all kanban buckets of a project @Description Returns all kanban buckets with belong to a project including their tasks. Buckets are always sorted by their `position` in ascending order. Tasks are sorted by their `kanban_position` in ascending order. @tags project @Accept json @Produce json @Security JWTKeyAuth @Param id path int true "Project Id" @Param page query int false "The page number for tasks. Used for pagination. If not provided, the first page of results is returned." @Param per_page query int false "The maximum number of tasks per bucket per page. This parameter is limited by the configured maximum of items per page." @Param s query string false "Search tasks by task text." @Param filter_by query string false "The name of the field to filter by. Allowed values are all task properties. Task properties which are their own object require passing in the id of that entity. Accepts an array for multiple filters which will be chanied together, all supplied filter must match." @Param filter_value query string false "The value to filter for." @Param filter_comparator query string false "The comparator to use for a filter. Available values are `equals`, `greater`, `greater_equals`, `less`, `less_equals`, `like` and `in`. `in` expects comma-separated values in `filter_value`. Defaults to `equals`" @Param filter_concat query string false "The concatinator to use for filters. Available values are `and` or `or`. Defaults to `or`." @Param filter_include_nulls query string false "If set to true the result will include filtered fields whose value is set to `null`. Available values are `true` or `false`. Defaults to `false`." @Success 200 {array} models.Bucket "The buckets with their tasks" @Failure 500 {object} models.Message "Internal server error" @Router /projects/{id}/buckets [get]

func (*Bucket) TableName

func (b *Bucket) TableName() string

TableName returns the table name for this bucket.

func (*Bucket) Update

func (b *Bucket) Update(s *xorm.Session, _ web.Auth) (err error)

Update Updates an existing bucket @Summary Update an existing bucket @Description Updates an existing kanban bucket. @tags project @Accept json @Produce json @Security JWTKeyAuth @Param projectID path int true "Project Id" @Param bucketID path int true "Bucket Id" @Param bucket body models.Bucket true "The bucket object" @Success 200 {object} models.Bucket "The created bucket object." @Failure 400 {object} web.HTTPError "Invalid bucket object provided." @Failure 404 {object} web.HTTPError "The bucket does not exist." @Failure 500 {object} models.Message "Internal error" @Router /projects/{projectID}/buckets/{bucketID} [post]

type BulkAssignees

type BulkAssignees struct {
	// A project with all assignees
	Assignees []*user.User `json:"assignees"`
	TaskID    int64        `json:"-" param:"projecttask"`

	web.CRUDable `json:"-"`
	web.Rights   `json:"-"`
}

BulkAssignees is a helper struct used to update multiple assignees at once.

func (*BulkAssignees) CanCreate

func (ba *BulkAssignees) CanCreate(s *xorm.Session, a web.Auth) (bool, error)

CanCreate checks if a user can add a new assignee

func (*BulkAssignees) Create

func (ba *BulkAssignees) Create(s *xorm.Session, a web.Auth) (err error)

Create adds new assignees to a task @Summary Add multiple new assignees to a task @Description Adds multiple new assignees to a task. The assignee needs to have access to the project, the doer must be able to edit this task. Every user not in the project will be unassigned from the task, pass an empty array to unassign everyone. @tags assignees @Accept json @Produce json @Security JWTKeyAuth @Param assignee body models.BulkAssignees true "The array of assignees" @Param taskID path int true "Task ID" @Success 201 {object} models.TaskAssginee "The created assingees object." @Failure 400 {object} web.HTTPError "Invalid assignee object provided." @Failure 500 {object} models.Message "Internal error" @Router /tasks/{taskID}/assignees/bulk [post]

type BulkTask

type BulkTask struct {
	// A project of task ids to update
	IDs   []int64 `json:"task_ids"`
	Tasks []*Task `json:"-"`
	Task
}

BulkTask is the definition of a bulk update task

func (*BulkTask) CanUpdate

func (bt *BulkTask) CanUpdate(s *xorm.Session, a web.Auth) (bool, error)

CanUpdate checks if a user is allowed to update a task

func (*BulkTask) GetTasksByIDs

func (bt *BulkTask) GetTasksByIDs(s *xorm.Session) (err error)

GetTasksByIDs returns all tasks for a project of ids

func (*BulkTask) Update

func (bt *BulkTask) Update(s *xorm.Session, a web.Auth) (err error)

Update updates a bunch of tasks at once @Summary Update a bunch of tasks at once @Description Updates a bunch of tasks at once. This includes marking them as done. Note: although you could supply another ID, it will be ignored. Use task_ids instead. @tags task @Accept json @Produce json @Security JWTKeyAuth @Param task body models.BulkTask true "The task object. Looks like a normal task, the only difference is it uses an array of project_ids to update." @Success 200 {object} models.Task "The updated task object." @Failure 400 {object} web.HTTPError "Invalid task object provided." @Failure 403 {object} web.HTTPError "The user does not have access to the task (aka its project)" @Failure 500 {object} models.Message "Internal error" @Router /tasks/bulk [post]

type DataExportReadyNotification added in v0.18.0

type DataExportReadyNotification struct {
	User *user.User `json:"user"`
}

DataExportReadyNotification represents a DataExportReadyNotification notification

func (*DataExportReadyNotification) Name added in v0.18.0

Name returns the name of the notification

func (*DataExportReadyNotification) ToDB added in v0.18.0

func (n *DataExportReadyNotification) ToDB() interface{}

ToDB returns the DataExportReadyNotification notification in a format which can be saved in the db

func (*DataExportReadyNotification) ToMail added in v0.18.0

ToMail returns the mail notification for DataExportReadyNotification

type DatabaseNotifications added in v0.17.0

type DatabaseNotifications struct {
	notifications.DatabaseNotification

	// Whether or not to mark this notification as read or unread.
	// True is read, false is unread.
	Read bool `xorm:"-" json:"read"`

	web.CRUDable `xorm:"-" json:"-"`
	web.Rights   `xorm:"-" json:"-"`
}

DatabaseNotifications is a wrapper around the crud operations that come with a database notification.

func (*DatabaseNotifications) CanUpdate added in v0.17.0

func (d *DatabaseNotifications) CanUpdate(s *xorm.Session, a web.Auth) (bool, error)

CanUpdate checks if a user can mark a notification as read.

func (*DatabaseNotifications) ReadAll added in v0.17.0

func (d *DatabaseNotifications) ReadAll(s *xorm.Session, a web.Auth, _ string, page int, perPage int) (ls interface{}, resultCount int, numberOfEntries int64, err error)

ReadAll returns all database notifications for a user @Summary Get all notifications for the current user @Description Returns an array with all notifications for the current user. @tags subscriptions @Accept json @Produce json @Param page query int false "The page number. Used for pagination. If not provided, the first page of results is returned." @Param per_page query int false "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page." @Security JWTKeyAuth @Success 200 {array} notifications.DatabaseNotification "The notifications" @Failure 403 {object} web.HTTPError "Link shares cannot have notifications." @Failure 500 {object} models.Message "Internal error" @Router /notifications [get]

func (*DatabaseNotifications) Update added in v0.17.0

func (d *DatabaseNotifications) Update(s *xorm.Session, _ web.Auth) (err error)

Update marks a notification as read. @Summary Mark a notification as (un-)read @Description Marks a notification as either read or unread. A user can only mark their own notifications as read. @tags subscriptions @Accept json @Produce json @Security JWTKeyAuth @Param id path int true "Notification ID" @Success 200 {object} models.DatabaseNotifications "The notification to mark as read." @Failure 403 {object} web.HTTPError "The user does not have access to that notification." @Failure 403 {object} web.HTTPError "Link shares cannot have notifications." @Failure 404 {object} web.HTTPError "The notification does not exist." @Failure 500 {object} models.Message "Internal error" @Router /notifications/{id} [post]

type DecreaseAttachmentCounter added in v0.22.0

type DecreaseAttachmentCounter struct {
}

DecreaseAttachmentCounter represents a listener

func (*DecreaseAttachmentCounter) Handle added in v0.22.0

func (s *DecreaseAttachmentCounter) Handle(_ *message.Message) (err error)

Handle is executed when the event DecreaseAttachmentCounter listens on is fired

func (*DecreaseAttachmentCounter) Name added in v0.22.0

Name defines the name for the DecreaseAttachmentCounter listener

type DecreaseProjectCounter added in v0.21.0

type DecreaseProjectCounter struct {
}

func (*DecreaseProjectCounter) Handle added in v0.21.0

func (s *DecreaseProjectCounter) Handle(_ *message.Message) (err error)

func (*DecreaseProjectCounter) Name added in v0.21.0

func (s *DecreaseProjectCounter) Name() string

type DecreaseTaskCounter added in v0.17.0

type DecreaseTaskCounter struct {
}

DecreaseTaskCounter represents a listener

func (*DecreaseTaskCounter) Handle added in v0.17.0

func (s *DecreaseTaskCounter) Handle(_ *message.Message) (err error)

Handle is executed when the event DecreaseTaskCounter listens on is fired

func (*DecreaseTaskCounter) Name added in v0.17.0

func (s *DecreaseTaskCounter) Name() string

Name defines the name for the DecreaseTaskCounter listener

type DecreaseTeamCounter added in v0.17.0

type DecreaseTeamCounter struct {
}

DecreaseTeamCounter represents a listener

func (*DecreaseTeamCounter) Handle added in v0.17.0

func (s *DecreaseTeamCounter) Handle(_ *message.Message) (err error)

Handle is executed when the event DecreaseTeamCounter listens on is fired

func (*DecreaseTeamCounter) Name added in v0.17.0

func (s *DecreaseTeamCounter) Name() string

Name defines the name for the DecreaseTeamCounter listener

type ErrAPITokenInvalid added in v0.22.0

type ErrAPITokenInvalid struct {
}

ErrAPITokenInvalid represents an error where an api token is invalid

func (*ErrAPITokenInvalid) Error added in v0.22.0

func (err *ErrAPITokenInvalid) Error() string

func (ErrAPITokenInvalid) HTTPError added in v0.22.0

func (err ErrAPITokenInvalid) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrAttachmentDoesNotBelongToTask added in v0.20.0

type ErrAttachmentDoesNotBelongToTask struct {
	TaskID       int64
	AttachmentID int64
}

ErrAttachmentDoesNotBelongToTask represents an error where the provided task cover attachment does not belong to the same task

func (ErrAttachmentDoesNotBelongToTask) Error added in v0.20.0

func (ErrAttachmentDoesNotBelongToTask) HTTPError added in v0.20.0

HTTPError holds the http error description

type ErrBucketDoesNotBelongToProject added in v0.21.0

type ErrBucketDoesNotBelongToProject struct {
	BucketID  int64
	ProjectID int64
}

ErrBucketDoesNotBelongToProject represents an error where a kanban bucket does not belong to a project

func (ErrBucketDoesNotBelongToProject) Error added in v0.21.0

func (ErrBucketDoesNotBelongToProject) HTTPError added in v0.21.0

HTTPError holds the http error description

type ErrBucketDoesNotExist

type ErrBucketDoesNotExist struct {
	BucketID int64
}

ErrBucketDoesNotExist represents an error where a kanban bucket does not exist

func (ErrBucketDoesNotExist) Error

func (err ErrBucketDoesNotExist) Error() string

func (ErrBucketDoesNotExist) HTTPError

func (err ErrBucketDoesNotExist) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrBucketLimitExceeded added in v0.15.0

type ErrBucketLimitExceeded struct {
	BucketID int64
	Limit    int64
	TaskID   int64 // may be 0
}

ErrBucketLimitExceeded represents an error where a task is being created or moved to a bucket which has its limit already exceeded.

func (ErrBucketLimitExceeded) Error added in v0.15.0

func (err ErrBucketLimitExceeded) Error() string

func (ErrBucketLimitExceeded) HTTPError added in v0.15.0

func (err ErrBucketLimitExceeded) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrBulkTasksMustBeInSameProject added in v0.21.0

type ErrBulkTasksMustBeInSameProject struct {
	ShouldBeID int64
	IsID       int64
}

ErrBulkTasksMustBeInSameProject represents a "ErrBulkTasksMustBeInSameProject" kind of error.

func (ErrBulkTasksMustBeInSameProject) Error added in v0.21.0

func (ErrBulkTasksMustBeInSameProject) HTTPError added in v0.21.0

HTTPError holds the http error description

type ErrBulkTasksNeedAtLeastOne

type ErrBulkTasksNeedAtLeastOne struct{}

ErrBulkTasksNeedAtLeastOne represents a "ErrBulkTasksNeedAtLeastOne" kind of error.

func (ErrBulkTasksNeedAtLeastOne) Error

func (err ErrBulkTasksNeedAtLeastOne) Error() string

func (ErrBulkTasksNeedAtLeastOne) HTTPError

func (err ErrBulkTasksNeedAtLeastOne) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrCannotArchiveDefaultProject added in v0.21.0

type ErrCannotArchiveDefaultProject struct {
	ProjectID int64
}

ErrCannotArchiveDefaultProject represents an error where the default project is being deleted

func (*ErrCannotArchiveDefaultProject) Error added in v0.21.0

func (*ErrCannotArchiveDefaultProject) HTTPError added in v0.21.0

func (err *ErrCannotArchiveDefaultProject) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrCannotDeleteDefaultProject added in v0.21.0

type ErrCannotDeleteDefaultProject struct {
	ProjectID int64
}

ErrCannotDeleteDefaultProject represents an error where the default project is being deleted

func (*ErrCannotDeleteDefaultProject) Error added in v0.21.0

func (*ErrCannotDeleteDefaultProject) HTTPError added in v0.21.0

func (err *ErrCannotDeleteDefaultProject) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrCannotDeleteLastTeamMember

type ErrCannotDeleteLastTeamMember struct {
	TeamID int64
	UserID int64
}

ErrCannotDeleteLastTeamMember represents an error where a user wants to delete the last member of a team (probably himself)

func (ErrCannotDeleteLastTeamMember) Error

func (ErrCannotDeleteLastTeamMember) HTTPError

HTTPError holds the http error description

type ErrCannotRemoveLastBucket

type ErrCannotRemoveLastBucket struct {
	BucketID  int64
	ProjectID int64
}

ErrCannotRemoveLastBucket represents an error where a kanban bucket is the last on a project and thus cannot be removed.

func (ErrCannotRemoveLastBucket) Error

func (err ErrCannotRemoveLastBucket) Error() string

func (ErrCannotRemoveLastBucket) HTTPError

func (err ErrCannotRemoveLastBucket) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrGenericForbidden

type ErrGenericForbidden struct{}

ErrGenericForbidden represents a "UsernameAlreadyExists" kind of error.

func (ErrGenericForbidden) Error

func (err ErrGenericForbidden) Error() string

func (ErrGenericForbidden) HTTPError

func (err ErrGenericForbidden) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrIDCannotBeZero

type ErrIDCannotBeZero struct{}

ErrIDCannotBeZero represents a "IDCannotBeZero" kind of error. Used if an ID (of something, not defined) is 0 where it should not.

func (ErrIDCannotBeZero) Error

func (err ErrIDCannotBeZero) Error() string

func (ErrIDCannotBeZero) HTTPError

func (err ErrIDCannotBeZero) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrInvalidAPITokenPermission added in v0.22.0

type ErrInvalidAPITokenPermission struct {
	Group      string
	Permission string
}

ErrInvalidAPITokenPermission represents an error where an api token is invalid

func (*ErrInvalidAPITokenPermission) Error added in v0.22.0

func (err *ErrInvalidAPITokenPermission) Error() string

func (ErrInvalidAPITokenPermission) HTTPError added in v0.22.0

func (err ErrInvalidAPITokenPermission) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrInvalidData

type ErrInvalidData struct {
	Message string
}

ErrInvalidData represents a "ErrInvalidData" kind of error. Used when a struct is invalid -> validation failed.

func (ErrInvalidData) Error

func (err ErrInvalidData) Error() string

func (ErrInvalidData) HTTPError

func (err ErrInvalidData) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrInvalidRelationKind

type ErrInvalidRelationKind struct {
	Kind RelationKind
}

ErrInvalidRelationKind represents an error where the user tries to use an invalid relation kind

func (ErrInvalidRelationKind) Error

func (err ErrInvalidRelationKind) Error() string

func (ErrInvalidRelationKind) HTTPError

func (err ErrInvalidRelationKind) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrInvalidRight

type ErrInvalidRight struct {
	Right Right
}

ErrInvalidRight represents an error where a right is invalid

func (ErrInvalidRight) Error

func (err ErrInvalidRight) Error() string

func (ErrInvalidRight) HTTPError

func (err ErrInvalidRight) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrInvalidSortOrder

type ErrInvalidSortOrder struct {
	OrderBy sortOrder
}

ErrInvalidSortOrder represents an error where the provided sort order is invalid

func (ErrInvalidSortOrder) Error

func (err ErrInvalidSortOrder) Error() string

func (ErrInvalidSortOrder) HTTPError

func (err ErrInvalidSortOrder) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrInvalidSortParam

type ErrInvalidSortParam struct {
	SortBy string
}

ErrInvalidSortParam represents an error where the provided sort param is invalid

func (ErrInvalidSortParam) Error

func (err ErrInvalidSortParam) Error() string

func (ErrInvalidSortParam) HTTPError

func (err ErrInvalidSortParam) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrInvalidTaskField

type ErrInvalidTaskField struct {
	TaskField string
}

ErrInvalidTaskField represents an error where the provided task field is invalid

func (ErrInvalidTaskField) Error

func (err ErrInvalidTaskField) Error() string

func (ErrInvalidTaskField) HTTPError

func (err ErrInvalidTaskField) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrInvalidTaskFilterComparator

type ErrInvalidTaskFilterComparator struct {
	Comparator taskFilterComparator
}

ErrInvalidTaskFilterComparator represents an error where the provided task field is invalid

func (ErrInvalidTaskFilterComparator) Error

func (ErrInvalidTaskFilterComparator) HTTPError

HTTPError holds the http error description

type ErrInvalidTaskFilterConcatinator

type ErrInvalidTaskFilterConcatinator struct {
	Concatinator taskFilterConcatinator
}

ErrInvalidTaskFilterConcatinator represents an error where the provided task field is invalid

func (ErrInvalidTaskFilterConcatinator) Error

func (ErrInvalidTaskFilterConcatinator) HTTPError

HTTPError holds the http error description

type ErrInvalidTaskFilterValue added in v0.14.0

type ErrInvalidTaskFilterValue struct {
	Value interface{}
	Field string
}

ErrInvalidTaskFilterValue represents an error where the provided task filter value is invalid

func (ErrInvalidTaskFilterValue) Error added in v0.14.0

func (err ErrInvalidTaskFilterValue) Error() string

func (ErrInvalidTaskFilterValue) HTTPError added in v0.14.0

func (err ErrInvalidTaskFilterValue) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrLabelDoesNotExist

type ErrLabelDoesNotExist struct {
	LabelID int64
}

ErrLabelDoesNotExist represents an error where a label does not exist

func (ErrLabelDoesNotExist) Error

func (err ErrLabelDoesNotExist) Error() string

func (ErrLabelDoesNotExist) HTTPError

func (err ErrLabelDoesNotExist) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrLabelIsAlreadyOnTask

type ErrLabelIsAlreadyOnTask struct {
	LabelID int64
	TaskID  int64
}

ErrLabelIsAlreadyOnTask represents an error where a label is already bound to a task

func (ErrLabelIsAlreadyOnTask) Error

func (err ErrLabelIsAlreadyOnTask) Error() string

func (ErrLabelIsAlreadyOnTask) HTTPError

func (err ErrLabelIsAlreadyOnTask) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrLinkSharePasswordInvalid added in v0.17.0

type ErrLinkSharePasswordInvalid struct {
	ShareID int64
}

ErrLinkSharePasswordInvalid represents an error where a subscription entity type is unknown

func (*ErrLinkSharePasswordInvalid) Error added in v0.17.0

func (err *ErrLinkSharePasswordInvalid) Error() string

func (ErrLinkSharePasswordInvalid) HTTPError added in v0.17.0

func (err ErrLinkSharePasswordInvalid) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrLinkSharePasswordRequired added in v0.17.0

type ErrLinkSharePasswordRequired struct {
	ShareID int64
}

ErrLinkSharePasswordRequired represents an error where a link share authentication requires a password and none was provided

func (*ErrLinkSharePasswordRequired) Error added in v0.17.0

func (err *ErrLinkSharePasswordRequired) Error() string

func (ErrLinkSharePasswordRequired) HTTPError added in v0.17.0

func (err ErrLinkSharePasswordRequired) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrLinkShareTokenInvalid added in v0.21.0

type ErrLinkShareTokenInvalid struct {
}

ErrLinkShareTokenInvalid represents an error where a link share token is invalid

func (*ErrLinkShareTokenInvalid) Error added in v0.21.0

func (err *ErrLinkShareTokenInvalid) Error() string

func (ErrLinkShareTokenInvalid) HTTPError added in v0.21.0

func (err ErrLinkShareTokenInvalid) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrNeedToHaveProjectReadAccess added in v0.21.0

type ErrNeedToHaveProjectReadAccess struct {
	ProjectID int64
	UserID    int64
}

ErrNeedToHaveProjectReadAccess represents an error, where the user dont has read access to that Project

func (ErrNeedToHaveProjectReadAccess) Error added in v0.21.0

func (ErrNeedToHaveProjectReadAccess) HTTPError added in v0.21.0

HTTPError holds the http error description

type ErrNoRightToSeeTask

type ErrNoRightToSeeTask struct {
	TaskID int64
	UserID int64
}

ErrNoRightToSeeTask represents an error where a user does not have the right to see a task

func (ErrNoRightToSeeTask) Error

func (err ErrNoRightToSeeTask) Error() string

func (ErrNoRightToSeeTask) HTTPError

func (err ErrNoRightToSeeTask) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrOnlyOneDoneBucketPerProject added in v0.21.0

type ErrOnlyOneDoneBucketPerProject struct {
	BucketID     int64
	ProjectID    int64
	DoneBucketID int64
}

ErrOnlyOneDoneBucketPerProject represents an error where a bucket is set to the done bucket but one already exists for its project.

func (*ErrOnlyOneDoneBucketPerProject) Error added in v0.21.0

func (*ErrOnlyOneDoneBucketPerProject) HTTPError added in v0.21.0

func (err *ErrOnlyOneDoneBucketPerProject) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrParentTaskCannotBeTheSame

type ErrParentTaskCannotBeTheSame struct {
	TaskID int64
}

ErrParentTaskCannotBeTheSame represents an error where the user tries to set a tasks parent as the same

func (ErrParentTaskCannotBeTheSame) Error

func (ErrParentTaskCannotBeTheSame) HTTPError

func (err ErrParentTaskCannotBeTheSame) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrProjectCannotBeChildOfItself added in v0.21.0

type ErrProjectCannotBeChildOfItself struct {
	ProjectID int64
}

ErrProjectCannotBeChildOfItself represents an error where a project cannot become a child of its own

func (*ErrProjectCannotBeChildOfItself) Error added in v0.21.0

func (*ErrProjectCannotBeChildOfItself) HTTPError added in v0.21.0

HTTPError holds the http error description

type ErrProjectCannotBelongToAPseudoParentProject added in v0.21.0

type ErrProjectCannotBelongToAPseudoParentProject struct {
	ProjectID       int64
	ParentProjectID int64
}

ErrProjectCannotBelongToAPseudoParentProject represents an error where a project cannot belong to a pseudo project

func (*ErrProjectCannotBelongToAPseudoParentProject) Error added in v0.21.0

func (*ErrProjectCannotBelongToAPseudoParentProject) HTTPError added in v0.21.0

HTTPError holds the http error description

type ErrProjectCannotHaveACyclicRelationship added in v0.21.0

type ErrProjectCannotHaveACyclicRelationship struct {
	ProjectID int64
	CycleIDs  []int64
}

ErrProjectCannotHaveACyclicRelationship represents an error where a project cannot have a cyclic parent relationship

func (*ErrProjectCannotHaveACyclicRelationship) CycleString added in v0.21.0

func (*ErrProjectCannotHaveACyclicRelationship) Error added in v0.21.0

func (*ErrProjectCannotHaveACyclicRelationship) HTTPError added in v0.21.0

HTTPError holds the http error description

type ErrProjectDoesNotExist added in v0.21.0

type ErrProjectDoesNotExist struct {
	ID int64
}

ErrProjectDoesNotExist represents a "ErrProjectDoesNotExist" kind of error. Used if the project does not exist.

func (ErrProjectDoesNotExist) Error added in v0.21.0

func (err ErrProjectDoesNotExist) Error() string

func (ErrProjectDoesNotExist) HTTPError added in v0.21.0

func (err ErrProjectDoesNotExist) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrProjectIdentifierIsNotUnique added in v0.21.0

type ErrProjectIdentifierIsNotUnique struct {
	Identifier string
}

ErrProjectIdentifierIsNotUnique represents a "ErrProjectIdentifierIsNotUnique" kind of error. Used if the provided project identifier is not unique.

func (ErrProjectIdentifierIsNotUnique) Error added in v0.21.0

func (ErrProjectIdentifierIsNotUnique) HTTPError added in v0.21.0

HTTPError holds the http error description

type ErrProjectIsArchived added in v0.21.0

type ErrProjectIsArchived struct {
	ProjectID int64
}

ErrProjectIsArchived represents an error, where a project is archived

func (ErrProjectIsArchived) Error added in v0.21.0

func (err ErrProjectIsArchived) Error() string

func (ErrProjectIsArchived) HTTPError added in v0.21.0

func (err ErrProjectIsArchived) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrProjectShareDoesNotExist added in v0.21.0

type ErrProjectShareDoesNotExist struct {
	ID   int64
	Hash string
}

ErrProjectShareDoesNotExist represents a "ErrProjectShareDoesNotExist" kind of error. Used if the project share does not exist.

func (ErrProjectShareDoesNotExist) Error added in v0.21.0

func (err ErrProjectShareDoesNotExist) Error() string

func (ErrProjectShareDoesNotExist) HTTPError added in v0.21.0

func (err ErrProjectShareDoesNotExist) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrProjectTitleCannotBeEmpty added in v0.21.0

type ErrProjectTitleCannotBeEmpty struct{}

ErrProjectTitleCannotBeEmpty represents a "ErrProjectTitleCannotBeEmpty" kind of error. Used if the project does not exist.

func (ErrProjectTitleCannotBeEmpty) Error added in v0.21.0

func (ErrProjectTitleCannotBeEmpty) HTTPError added in v0.21.0

func (err ErrProjectTitleCannotBeEmpty) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrRelationAlreadyExists

type ErrRelationAlreadyExists struct {
	Kind        RelationKind
	TaskID      int64
	OtherTaskID int64
}

ErrRelationAlreadyExists represents an error where the user tries to create an already existing relation

func (ErrRelationAlreadyExists) Error

func (err ErrRelationAlreadyExists) Error() string

func (ErrRelationAlreadyExists) HTTPError

func (err ErrRelationAlreadyExists) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrRelationDoesNotExist

type ErrRelationDoesNotExist struct {
	Kind        RelationKind
	TaskID      int64
	OtherTaskID int64
}

ErrRelationDoesNotExist represents an error where a task relation does not exist.

func (ErrRelationDoesNotExist) Error

func (err ErrRelationDoesNotExist) Error() string

func (ErrRelationDoesNotExist) HTTPError

func (err ErrRelationDoesNotExist) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrRelationTasksCannotBeTheSame

type ErrRelationTasksCannotBeTheSame struct {
	TaskID      int64
	OtherTaskID int64
}

ErrRelationTasksCannotBeTheSame represents an error where the user tries to relate a task with itself

func (ErrRelationTasksCannotBeTheSame) Error

func (ErrRelationTasksCannotBeTheSame) HTTPError

HTTPError holds the http error description

type ErrReminderRelativeToMissing added in v0.21.0

type ErrReminderRelativeToMissing struct {
	TaskID int64
}

ErrReminderRelativeToMissing represents an error where a task has a relative reminder without reference date

func (ErrReminderRelativeToMissing) Error added in v0.21.0

func (ErrReminderRelativeToMissing) HTTPError added in v0.21.0

func (err ErrReminderRelativeToMissing) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrSavedFilterDoesNotExist added in v0.15.0

type ErrSavedFilterDoesNotExist struct {
	SavedFilterID int64
}

ErrSavedFilterDoesNotExist represents an error where a kanban bucket does not exist

func (ErrSavedFilterDoesNotExist) Error added in v0.15.0

func (err ErrSavedFilterDoesNotExist) Error() string

func (ErrSavedFilterDoesNotExist) HTTPError added in v0.15.0

func (err ErrSavedFilterDoesNotExist) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrSavedFilterNotAvailableForLinkShare added in v0.15.0

type ErrSavedFilterNotAvailableForLinkShare struct {
	SavedFilterID int64
	LinkShareID   int64
}

ErrSavedFilterNotAvailableForLinkShare represents an error where a kanban bucket does not exist

func (ErrSavedFilterNotAvailableForLinkShare) Error added in v0.15.0

func (ErrSavedFilterNotAvailableForLinkShare) HTTPError added in v0.15.0

HTTPError holds the http error description

type ErrSubscriptionAlreadyExists added in v0.17.0

type ErrSubscriptionAlreadyExists struct {
	EntityID   int64
	EntityType SubscriptionEntityType
	UserID     int64
}

ErrSubscriptionAlreadyExists represents an error where a subscription entity already exists

func (*ErrSubscriptionAlreadyExists) Error added in v0.17.0

func (err *ErrSubscriptionAlreadyExists) Error() string

func (ErrSubscriptionAlreadyExists) HTTPError added in v0.17.0

func (err ErrSubscriptionAlreadyExists) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrTaskAttachmentDoesNotExist

type ErrTaskAttachmentDoesNotExist struct {
	TaskID       int64
	AttachmentID int64
	FileID       int64
}

ErrTaskAttachmentDoesNotExist represents an error where the user tries to relate a task with itself

func (ErrTaskAttachmentDoesNotExist) Error

func (ErrTaskAttachmentDoesNotExist) HTTPError

HTTPError holds the http error description

type ErrTaskAttachmentIsTooLarge

type ErrTaskAttachmentIsTooLarge struct {
	Size uint64
}

ErrTaskAttachmentIsTooLarge represents an error where the user tries to relate a task with itself

func (ErrTaskAttachmentIsTooLarge) Error

func (err ErrTaskAttachmentIsTooLarge) Error() string

func (ErrTaskAttachmentIsTooLarge) HTTPError

func (err ErrTaskAttachmentIsTooLarge) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrTaskCannotBeEmpty

type ErrTaskCannotBeEmpty struct{}

ErrTaskCannotBeEmpty represents a "ErrTaskCannotBeEmpty" kind of error.

func (ErrTaskCannotBeEmpty) Error

func (err ErrTaskCannotBeEmpty) Error() string

func (ErrTaskCannotBeEmpty) HTTPError

func (err ErrTaskCannotBeEmpty) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrTaskCommentDoesNotExist

type ErrTaskCommentDoesNotExist struct {
	ID     int64
	TaskID int64
}

ErrTaskCommentDoesNotExist represents an error where a task comment does not exist

func (ErrTaskCommentDoesNotExist) Error

func (err ErrTaskCommentDoesNotExist) Error() string

func (ErrTaskCommentDoesNotExist) HTTPError

func (err ErrTaskCommentDoesNotExist) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrTaskDoesNotExist

type ErrTaskDoesNotExist struct {
	ID int64
}

ErrTaskDoesNotExist represents a "ErrProjectDoesNotExist" kind of error. Used if the project does not exist.

func (ErrTaskDoesNotExist) Error

func (err ErrTaskDoesNotExist) Error() string

func (ErrTaskDoesNotExist) HTTPError

func (err ErrTaskDoesNotExist) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrTaskRelationCycle added in v0.23.0

type ErrTaskRelationCycle struct {
	Kind        RelationKind
	TaskID      int64
	OtherTaskID int64
}

ErrTaskRelationCycle represents an error where the user tries to create an already existing relation

func (ErrTaskRelationCycle) Error added in v0.23.0

func (err ErrTaskRelationCycle) Error() string

func (ErrTaskRelationCycle) HTTPError added in v0.23.0

func (err ErrTaskRelationCycle) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrTeamAlreadyHasAccess

type ErrTeamAlreadyHasAccess struct {
	TeamID int64
	ID     int64
}

ErrTeamAlreadyHasAccess represents an error where a team already has access to a project

func (ErrTeamAlreadyHasAccess) Error

func (err ErrTeamAlreadyHasAccess) Error() string

func (ErrTeamAlreadyHasAccess) HTTPError

func (err ErrTeamAlreadyHasAccess) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrTeamDoesNotExist

type ErrTeamDoesNotExist struct {
	TeamID int64
}

ErrTeamDoesNotExist represents an error where a team does not exist

func (ErrTeamDoesNotExist) Error

func (err ErrTeamDoesNotExist) Error() string

func (ErrTeamDoesNotExist) HTTPError

func (err ErrTeamDoesNotExist) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrTeamDoesNotHaveAccessToProject added in v0.21.0

type ErrTeamDoesNotHaveAccessToProject struct {
	ProjectID int64
	TeamID    int64
}

ErrTeamDoesNotHaveAccessToProject represents an error, where the Team is not the owner of that Project (used i.e. when deleting a Project)

func (ErrTeamDoesNotHaveAccessToProject) Error added in v0.21.0

func (ErrTeamDoesNotHaveAccessToProject) HTTPError added in v0.21.0

HTTPError holds the http error description

type ErrTeamNameCannotBeEmpty

type ErrTeamNameCannotBeEmpty struct {
	TeamID int64
}

ErrTeamNameCannotBeEmpty represents an error where a team name is empty.

func (ErrTeamNameCannotBeEmpty) Error

func (err ErrTeamNameCannotBeEmpty) Error() string

func (ErrTeamNameCannotBeEmpty) HTTPError

func (err ErrTeamNameCannotBeEmpty) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrUnknownSubscriptionEntityType added in v0.17.0

type ErrUnknownSubscriptionEntityType struct {
	EntityType SubscriptionEntityType
}

ErrUnknownSubscriptionEntityType represents an error where a subscription entity type is unknown

func (*ErrUnknownSubscriptionEntityType) Error added in v0.17.0

func (ErrUnknownSubscriptionEntityType) HTTPError added in v0.17.0

HTTPError holds the http error description

type ErrUserAlreadyAssigned added in v0.20.0

type ErrUserAlreadyAssigned struct {
	TaskID int64
	UserID int64
}

ErrUserAlreadyAssigned represents an error where the user is already assigned to this task

func (ErrUserAlreadyAssigned) Error added in v0.20.0

func (err ErrUserAlreadyAssigned) Error() string

func (ErrUserAlreadyAssigned) HTTPError added in v0.20.0

func (err ErrUserAlreadyAssigned) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrUserAlreadyHasAccess

type ErrUserAlreadyHasAccess struct {
	UserID    int64
	ProjectID int64
}

ErrUserAlreadyHasAccess represents an error where a user already has access to a project

func (ErrUserAlreadyHasAccess) Error

func (err ErrUserAlreadyHasAccess) Error() string

func (ErrUserAlreadyHasAccess) HTTPError

func (err ErrUserAlreadyHasAccess) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrUserDoesNotHaveAccessToProject added in v0.21.0

type ErrUserDoesNotHaveAccessToProject struct {
	ProjectID int64
	UserID    int64
}

ErrUserDoesNotHaveAccessToProject represents an error, where the user is not the owner of that Project (used i.e. when deleting a Project)

func (ErrUserDoesNotHaveAccessToProject) Error added in v0.21.0

func (ErrUserDoesNotHaveAccessToProject) HTTPError added in v0.21.0

HTTPError holds the http error description

type ErrUserHasNoAccessToLabel

type ErrUserHasNoAccessToLabel struct {
	LabelID int64
	UserID  int64
}

ErrUserHasNoAccessToLabel represents an error where a user does not have the right to see a label

func (ErrUserHasNoAccessToLabel) Error

func (err ErrUserHasNoAccessToLabel) Error() string

func (ErrUserHasNoAccessToLabel) HTTPError

func (err ErrUserHasNoAccessToLabel) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrUserIsMemberOfTeam

type ErrUserIsMemberOfTeam struct {
	TeamID int64
	UserID int64
}

ErrUserIsMemberOfTeam represents an error where a user is already member of a team.

func (ErrUserIsMemberOfTeam) Error

func (err ErrUserIsMemberOfTeam) Error() string

func (ErrUserIsMemberOfTeam) HTTPError

func (err ErrUserIsMemberOfTeam) HTTPError() web.HTTPError

HTTPError holds the http error description

type Favorite added in v0.18.0

type Favorite struct {
	EntityID int64        `xorm:"bigint not null pk"`
	UserID   int64        `xorm:"bigint not null pk"`
	Kind     FavoriteKind `xorm:"int not null pk"`
}

Favorite represents an entity which is a favorite to someone

func (*Favorite) TableName added in v0.18.0

func (t *Favorite) TableName() string

TableName is the table name

type FavoriteKind added in v0.18.0

type FavoriteKind int

FavoriteKind represents the kind of entities that can be marked as favorite

const (
	FavoriteKindUnknown FavoriteKind = iota
	FavoriteKindTask
	FavoriteKindProject
)

type HandleTaskCommentEditMentions added in v0.18.0

type HandleTaskCommentEditMentions struct {
}

HandleTaskCommentEditMentions represents a listener

func (*HandleTaskCommentEditMentions) Handle added in v0.18.0

func (s *HandleTaskCommentEditMentions) Handle(msg *message.Message) (err error)

Handle is executed when the event HandleTaskCommentEditMentions listens on is fired

func (*HandleTaskCommentEditMentions) Name added in v0.18.0

Name defines the name for the HandleTaskCommentEditMentions listener

type HandleTaskCreateMentions added in v0.18.0

type HandleTaskCreateMentions struct {
}

HandleTaskCreateMentions represents a listener

func (*HandleTaskCreateMentions) Handle added in v0.18.0

func (s *HandleTaskCreateMentions) Handle(msg *message.Message) (err error)

Handle is executed when the event HandleTaskCreateMentions listens on is fired

func (*HandleTaskCreateMentions) Name added in v0.18.0

func (s *HandleTaskCreateMentions) Name() string

Name defines the name for the HandleTaskCreateMentions listener

type HandleTaskUpdateLastUpdated added in v0.20.3

type HandleTaskUpdateLastUpdated struct {
}

HandleTaskUpdateLastUpdated represents a listener

func (*HandleTaskUpdateLastUpdated) Handle added in v0.20.3

func (s *HandleTaskUpdateLastUpdated) Handle(msg *message.Message) (err error)

Handle is executed when the event HandleTaskUpdateLastUpdated listens on is fired

func (*HandleTaskUpdateLastUpdated) Name added in v0.20.3

Name defines the name for the HandleTaskUpdateLastUpdated listener

type HandleTaskUpdatedMentions added in v0.18.0

type HandleTaskUpdatedMentions struct {
}

HandleTaskUpdatedMentions represents a listener

func (*HandleTaskUpdatedMentions) Handle added in v0.18.0

func (s *HandleTaskUpdatedMentions) Handle(msg *message.Message) (err error)

Handle is executed when the event HandleTaskUpdatedMentions listens on is fired

func (*HandleTaskUpdatedMentions) Name added in v0.18.0

Name defines the name for the HandleTaskUpdatedMentions listener

type HandleUserDataExport added in v0.18.0

type HandleUserDataExport struct {
}

HandleUserDataExport represents a listener

func (*HandleUserDataExport) Handle added in v0.18.0

func (s *HandleUserDataExport) Handle(msg *message.Message) (err error)

Handle is executed when the event HandleUserDataExport listens on is fired

func (*HandleUserDataExport) Name added in v0.18.0

func (s *HandleUserDataExport) Name() string

Name defines the name for the HandleUserDataExport listener

type IncreaseAttachmentCounter added in v0.22.0

type IncreaseAttachmentCounter struct {
}

IncreaseAttachmentCounter represents a listener

func (*IncreaseAttachmentCounter) Handle added in v0.22.0

func (s *IncreaseAttachmentCounter) Handle(_ *message.Message) (err error)

Handle is executed when the event IncreaseAttachmentCounter listens on is fired

func (*IncreaseAttachmentCounter) Name added in v0.22.0

Name defines the name for the IncreaseAttachmentCounter listener

type IncreaseProjectCounter added in v0.21.0

type IncreaseProjectCounter struct {
}

func (*IncreaseProjectCounter) Handle added in v0.21.0

func (s *IncreaseProjectCounter) Handle(_ *message.Message) (err error)

func (*IncreaseProjectCounter) Name added in v0.21.0

func (s *IncreaseProjectCounter) Name() string

type IncreaseTaskCounter added in v0.17.0

type IncreaseTaskCounter struct {
}

IncreaseTaskCounter represents a listener

func (*IncreaseTaskCounter) Handle added in v0.17.0

func (s *IncreaseTaskCounter) Handle(_ *message.Message) (err error)

Handle is executed when the event IncreaseTaskCounter listens on is fired

func (*IncreaseTaskCounter) Name added in v0.17.0

func (s *IncreaseTaskCounter) Name() string

Name defines the name for the IncreaseTaskCounter listener

type IncreaseTeamCounter added in v0.17.0

type IncreaseTeamCounter struct {
}

IncreaseTeamCounter represents a listener

func (*IncreaseTeamCounter) Handle added in v0.17.0

func (s *IncreaseTeamCounter) Handle(_ *message.Message) (err error)

Handle is executed when the event IncreaseTeamCounter listens on is fired

func (*IncreaseTeamCounter) Name added in v0.17.0

func (s *IncreaseTeamCounter) Name() string

Name defines the name for the IncreaseTeamCounter listener

type Label

type Label struct {
	// The unique, numeric id of this label.
	ID int64 `xorm:"bigint autoincr not null unique pk" json:"id" param:"label"`
	// The title of the lable. You'll see this one on tasks associated with it.
	Title string `xorm:"varchar(250) not null" json:"title" valid:"runelength(1|250)" minLength:"1" maxLength:"250"`
	// The label description.
	Description string `xorm:"longtext null" json:"description"`
	// The color this label has in hex format.
	HexColor string `xorm:"varchar(6) null" json:"hex_color" valid:"runelength(0|7)" maxLength:"7"`

	CreatedByID int64 `xorm:"bigint not null" json:"-"`
	// The user who created this label
	CreatedBy *user.User `xorm:"-" json:"created_by"`

	// A timestamp when this label was created. You cannot change this value.
	Created time.Time `xorm:"created not null" json:"created"`
	// A timestamp when this label was last updated. You cannot change this value.
	Updated time.Time `xorm:"updated not null" json:"updated"`

	web.CRUDable `xorm:"-" json:"-"`
	web.Rights   `xorm:"-" json:"-"`
}

Label represents a label

func GetLabelSimple added in v0.20.3

func GetLabelSimple(s *xorm.Session, l *Label) (*Label, error)

func (*Label) CanCreate

func (l *Label) CanCreate(_ *xorm.Session, a web.Auth) (bool, error)

CanCreate checks if the user can create a label Currently a dummy.

func (*Label) CanDelete

func (l *Label) CanDelete(s *xorm.Session, a web.Auth) (bool, error)

CanDelete checks if a user can delete a label

func (*Label) CanRead

func (l *Label) CanRead(s *xorm.Session, a web.Auth) (bool, int, error)

CanRead checks if a user can read a label

func (*Label) CanUpdate

func (l *Label) CanUpdate(s *xorm.Session, a web.Auth) (bool, error)

CanUpdate checks if a user can update a label

func (*Label) Create

func (l *Label) Create(s *xorm.Session, a web.Auth) (err error)

Create creates a new label @Summary Create a label @Description Creates a new label. @tags labels @Accept json @Produce json @Security JWTKeyAuth @Param label body models.Label true "The label object" @Success 201 {object} models.Label "The created label object." @Failure 400 {object} web.HTTPError "Invalid label object provided." @Failure 500 {object} models.Message "Internal error" @Router /labels [put]

func (*Label) Delete

func (l *Label) Delete(s *xorm.Session, _ web.Auth) (err error)

Delete deletes a label @Summary Delete a label @Description Delete an existing label. The user needs to be the creator of the label to be able to do this. @tags labels @Accept json @Produce json @Security JWTKeyAuth @Param id path int true "Label ID" @Success 200 {object} models.Label "The label was successfully deleted." @Failure 403 {object} web.HTTPError "Not allowed to delete the label." @Failure 404 {object} web.HTTPError "Label not found." @Failure 500 {object} models.Message "Internal error" @Router /labels/{id} [delete]

func (*Label) ReadAll

func (l *Label) ReadAll(s *xorm.Session, a web.Auth, search string, page int, perPage int) (ls interface{}, resultCount int, numberOfEntries int64, err error)

ReadAll gets all labels a user can use @Summary Get all labels a user has access to @Description Returns all labels which are either created by the user or associated with a task the user has at least read-access to. @tags labels @Accept json @Produce json @Param page query int false "The page number. Used for pagination. If not provided, the first page of results is returned." @Param per_page query int false "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page." @Param s query string false "Search labels by label text." @Security JWTKeyAuth @Success 200 {array} models.Label "The labels" @Failure 500 {object} models.Message "Internal error" @Router /labels [get]

func (*Label) ReadOne

func (l *Label) ReadOne(s *xorm.Session, _ web.Auth) (err error)

ReadOne gets one label @Summary Gets one label @Description Returns one label by its ID. @tags labels @Accept json @Produce json @Param id path int true "Label ID" @Security JWTKeyAuth @Success 200 {object} models.Label "The label" @Failure 403 {object} web.HTTPError "The user does not have access to the label" @Failure 404 {object} web.HTTPError "Label not found" @Failure 500 {object} models.Message "Internal error" @Router /labels/{id} [get]

func (Label) TableName

func (Label) TableName() string

TableName makes a pretty table name

func (*Label) Update

func (l *Label) Update(s *xorm.Session, a web.Auth) (err error)

Update updates a label @Summary Update a label @Description Update an existing label. The user needs to be the creator of the label to be able to do this. @tags labels @Accept json @Produce json @Security JWTKeyAuth @Param id path int true "Label ID" @Param label body models.Label true "The label object" @Success 200 {object} models.Label "The created label object." @Failure 400 {object} web.HTTPError "Invalid label object provided." @Failure 403 {object} web.HTTPError "Not allowed to update the label." @Failure 404 {object} web.HTTPError "Label not found." @Failure 500 {object} models.Message "Internal error" @Router /labels/{id} [put]

type LabelByTaskIDsOptions

type LabelByTaskIDsOptions struct {
	User                *user.User
	Search              []string
	Page                int
	PerPage             int
	TaskIDs             []int64
	GetUnusedLabels     bool
	GroupByLabelIDsOnly bool
	GetForUser          int64
}

LabelByTaskIDsOptions is a struct to not clutter the function with too many optional parameters.

type LabelTask

type LabelTask struct {
	// The unique, numeric id of this label.
	ID     int64 `xorm:"bigint autoincr not null unique pk" json:"-"`
	TaskID int64 `xorm:"bigint INDEX not null" json:"-" param:"projecttask"`
	// The label id you want to associate with a task.
	LabelID int64 `xorm:"bigint INDEX not null" json:"label_id" param:"label"`
	// A timestamp when this task was created. You cannot change this value.
	Created time.Time `xorm:"created not null" json:"created"`

	web.CRUDable `xorm:"-" json:"-"`
	web.Rights   `xorm:"-" json:"-"`
}

LabelTask represents a relation between a label and a task

func (*LabelTask) CanCreate

func (lt *LabelTask) CanCreate(s *xorm.Session, a web.Auth) (bool, error)

CanCreate checks if a user can add a label to a task

func (*LabelTask) CanDelete

func (lt *LabelTask) CanDelete(s *xorm.Session, a web.Auth) (bool, error)

CanDelete checks if a user can delete a label from a task

func (*LabelTask) Create

func (lt *LabelTask) Create(s *xorm.Session, _ web.Auth) (err error)

Create adds a label to a task @Summary Add a label to a task @Description Add a label to a task. The user needs to have write-access to the project to be able do this. @tags labels @Accept json @Produce json @Security JWTKeyAuth @Param task path int true "Task ID" @Param label body models.LabelTask true "The label object" @Success 201 {object} models.LabelTask "The created label relation object." @Failure 400 {object} web.HTTPError "Invalid label object provided." @Failure 403 {object} web.HTTPError "Not allowed to add the label." @Failure 404 {object} web.HTTPError "The label does not exist." @Failure 500 {object} models.Message "Internal error" @Router /tasks/{task}/labels [put]

func (*LabelTask) Delete

func (lt *LabelTask) Delete(s *xorm.Session, _ web.Auth) (err error)

Delete deletes a label on a task @Summary Remove a label from a task @Description Remove a label from a task. The user needs to have write-access to the project to be able do this. @tags labels @Accept json @Produce json @Security JWTKeyAuth @Param task path int true "Task ID" @Param label path int true "Label ID" @Success 200 {object} models.Message "The label was successfully removed." @Failure 403 {object} web.HTTPError "Not allowed to remove the label." @Failure 404 {object} web.HTTPError "Label not found." @Failure 500 {object} models.Message "Internal error" @Router /tasks/{task}/labels/{label} [delete]

func (*LabelTask) ReadAll

func (lt *LabelTask) ReadAll(s *xorm.Session, a web.Auth, search string, page int, _ int) (result interface{}, resultCount int, numberOfTotalItems int64, err error)

ReadAll gets all labels on a task @Summary Get all labels on a task @Description Returns all labels which are assicociated with a given task. @tags labels @Accept json @Produce json @Param task path int true "Task ID" @Param page query int false "The page number. Used for pagination. If not provided, the first page of results is returned." @Param per_page query int false "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page." @Param s query string false "Search labels by label text." @Security JWTKeyAuth @Success 200 {array} models.Label "The labels" @Failure 500 {object} models.Message "Internal error" @Router /tasks/{task}/labels [get]

func (LabelTask) TableName

func (LabelTask) TableName() string

TableName makes a pretty table name

type LabelTaskBulk

type LabelTaskBulk struct {
	// All labels you want to update at once.
	Labels []*Label `json:"labels"`
	TaskID int64    `json:"-" param:"projecttask"`

	web.CRUDable `json:"-"`
	web.Rights   `json:"-"`
}

LabelTaskBulk is a helper struct to update a bunch of labels at once

func (*LabelTaskBulk) CanCreate

func (ltb *LabelTaskBulk) CanCreate(s *xorm.Session, a web.Auth) (bool, error)

CanCreate determines if a user can update a labeltask

func (*LabelTaskBulk) Create

func (ltb *LabelTaskBulk) Create(s *xorm.Session, a web.Auth) (err error)

Create updates a bunch of labels on a task at once @Summary Update all labels on a task. @Description Updates all labels on a task. Every label which is not passed but exists on the task will be deleted. Every label which does not exist on the task will be added. All labels which are passed and already exist on the task won't be touched. @tags labels @Accept json @Produce json @Security JWTKeyAuth @Param label body models.LabelTaskBulk true "The array of labels" @Param taskID path int true "Task ID" @Success 201 {object} models.LabelTaskBulk "The updated labels object." @Failure 400 {object} web.HTTPError "Invalid label object provided." @Failure 500 {object} models.Message "Internal error" @Router /tasks/{taskID}/labels/bulk [post]

type LabelWithTaskID added in v0.20.3

type LabelWithTaskID struct {
	TaskID int64 `json:"-"`
	Label  `xorm:"extends"`
}

LabelWithTaskID is a helper struct, contains the label + its task ID

func GetLabelsByTaskIDs added in v0.20.3

func GetLabelsByTaskIDs(s *xorm.Session, opts *LabelByTaskIDsOptions) (ls []*LabelWithTaskID, resultCount int, totalEntries int64, err error)

GetLabelsByTaskIDs is a helper function to get all labels for a set of tasks Used when getting all labels for one task as well when getting all lables

type LinkSharing

type LinkSharing struct {
	// The ID of the shared thing
	ID int64 `xorm:"bigint autoincr not null unique pk" json:"id" param:"share"`
	// The public id to get this shared project
	Hash string `xorm:"varchar(40) not null unique" json:"hash" param:"hash"`
	// The name of this link share. All actions someone takes while being authenticated with that link will appear with that name.
	Name string `xorm:"text null" json:"name"`
	// The ID of the shared project
	ProjectID int64 `xorm:"bigint not null" json:"-" param:"project"`
	// The right this project is shared with. 0 = Read only, 1 = Read & Write, 2 = Admin. See the docs for more details.
	Right Right `xorm:"bigint INDEX not null default 0" json:"right" valid:"length(0|2)" maximum:"2" default:"0"`

	// The kind of this link. 0 = undefined, 1 = without password, 2 = with password.
	SharingType SharingType `xorm:"bigint INDEX not null default 0" json:"sharing_type" valid:"length(0|2)" maximum:"2" default:"0"`

	// The password of this link share. You can only set it, not retrieve it after the link share has been created.
	Password string `xorm:"text null" json:"password"`

	// The user who shared this project
	SharedBy   *user.User `xorm:"-" json:"shared_by"`
	SharedByID int64      `xorm:"bigint INDEX not null" json:"-"`

	// A timestamp when this project was shared. You cannot change this value.
	Created time.Time `xorm:"created not null" json:"created"`
	// A timestamp when this share was last updated. You cannot change this value.
	Updated time.Time `xorm:"updated not null" json:"updated"`

	web.CRUDable `xorm:"-" json:"-"`
	web.Rights   `xorm:"-" json:"-"`
}

LinkSharing represents a shared project

func GetLinkShareByHash

func GetLinkShareByHash(s *xorm.Session, hash string) (share *LinkSharing, err error)

GetLinkShareByHash returns a link share by hash

func GetLinkShareByID added in v0.17.0

func GetLinkShareByID(s *xorm.Session, id int64) (share *LinkSharing, err error)

GetLinkShareByID returns a link share by its id.

func GetLinkShareFromClaims

func GetLinkShareFromClaims(claims jwt.MapClaims) (share *LinkSharing, err error)

GetLinkShareFromClaims builds a link sharing object from jwt claims

func (*LinkSharing) CanCreate

func (share *LinkSharing) CanCreate(s *xorm.Session, a web.Auth) (bool, error)

CanCreate implements the create right check for a link share

func (*LinkSharing) CanDelete

func (share *LinkSharing) CanDelete(s *xorm.Session, a web.Auth) (bool, error)

CanDelete implements the delete right check for a link share

func (*LinkSharing) CanRead

func (share *LinkSharing) CanRead(s *xorm.Session, a web.Auth) (bool, int, error)

CanRead implements the read right check for a link share

func (*LinkSharing) CanUpdate

func (share *LinkSharing) CanUpdate(s *xorm.Session, a web.Auth) (bool, error)

CanUpdate implements the update right check for a link share

func (*LinkSharing) Create

func (share *LinkSharing) Create(s *xorm.Session, a web.Auth) (err error)

Create creates a new link share for a given project @Summary Share a project via link @Description Share a project via link. The user needs to have write-access to the project to be able do this. @tags sharing @Accept json @Produce json @Security JWTKeyAuth @Param project path int true "Project ID" @Param label body models.LinkSharing true "The new link share object" @Success 201 {object} models.LinkSharing "The created link share object." @Failure 400 {object} web.HTTPError "Invalid link share object provided." @Failure 403 {object} web.HTTPError "Not allowed to add the project share." @Failure 404 {object} web.HTTPError "The project does not exist." @Failure 500 {object} models.Message "Internal error" @Router /projects/{project}/shares [put]

func (*LinkSharing) Delete

func (share *LinkSharing) Delete(s *xorm.Session, _ web.Auth) (err error)

Delete removes a link share @Summary Remove a link share @Description Remove a link share. The user needs to have write-access to the project to be able do this. @tags sharing @Accept json @Produce json @Security JWTKeyAuth @Param project path int true "Project ID" @Param share path int true "Share Link ID" @Success 200 {object} models.Message "The link was successfully removed." @Failure 403 {object} web.HTTPError "Not allowed to remove the link." @Failure 404 {object} web.HTTPError "Share Link not found." @Failure 500 {object} models.Message "Internal error" @Router /projects/{project}/shares/{share} [delete]

func (*LinkSharing) GetID

func (share *LinkSharing) GetID() int64

GetID returns the ID of the links sharing object

func (*LinkSharing) ReadAll

func (share *LinkSharing) ReadAll(s *xorm.Session, a web.Auth, search string, page int, perPage int) (result interface{}, resultCount int, totalItems int64, err error)

ReadAll returns all shares for a given project @Summary Get all link shares for a project @Description Returns all link shares which exist for a given project @tags sharing @Accept json @Produce json @Param project path int true "Project ID" @Param page query int false "The page number. Used for pagination. If not provided, the first page of results is returned." @Param per_page query int false "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page." @Param s query string false "Search shares by hash." @Security JWTKeyAuth @Success 200 {array} models.LinkSharing "The share links" @Failure 500 {object} models.Message "Internal error" @Router /projects/{project}/shares [get]

func (*LinkSharing) ReadOne

func (share *LinkSharing) ReadOne(s *xorm.Session, _ web.Auth) (err error)

ReadOne returns one share @Summary Get one link shares for a project @Description Returns one link share by its ID. @tags sharing @Accept json @Produce json @Param project path int true "Project ID" @Param share path int true "Share ID" @Security JWTKeyAuth @Success 200 {object} models.LinkSharing "The share links" @Failure 403 {object} web.HTTPError "No access to the project" @Failure 404 {object} web.HTTPError "Share Link not found." @Failure 500 {object} models.Message "Internal error" @Router /projects/{project}/shares/{share} [get]

func (LinkSharing) TableName

func (LinkSharing) TableName() string

TableName holds the table name

type Message

type Message struct {
	// A standard message.
	Message string `json:"message"`
}

Message is a standard message

type Project added in v0.21.0

type Project struct {
	// The unique, numeric id of this project.
	ID int64 `xorm:"bigint autoincr not null unique pk" json:"id" param:"project"`
	// The title of the project. You'll see this in the overview.
	Title string `xorm:"varchar(250) not null" json:"title" valid:"required,runelength(1|250)" minLength:"1" maxLength:"250"`
	// The description of the project.
	Description string `xorm:"longtext null" json:"description"`
	// The unique project short identifier. Used to build task identifiers.
	Identifier string `xorm:"varchar(10) null" json:"identifier" valid:"runelength(0|10)" minLength:"0" maxLength:"10"`
	// The hex color of this project
	HexColor string `xorm:"varchar(6) null" json:"hex_color" valid:"runelength(0|7)" maxLength:"7"`

	OwnerID         int64    `xorm:"bigint INDEX not null" json:"-"`
	ParentProjectID int64    `xorm:"bigint INDEX null" json:"parent_project_id"`
	ParentProject   *Project `xorm:"-" json:"-"`

	// The ID of the bucket where new tasks without a bucket are added to. By default, this is the leftmost bucket in a project.
	DefaultBucketID int64 `xorm:"bigint INDEX null" json:"default_bucket_id"`
	// If tasks are moved to the done bucket, they are marked as done. If they are marked as done individually, they are moved into the done bucket.
	DoneBucketID int64 `xorm:"bigint INDEX null" json:"done_bucket_id"`

	// The user who created this project.
	Owner *user.User `xorm:"-" json:"owner" valid:"-"`

	// Whether a project is archived.
	IsArchived bool `xorm:"not null default false" json:"is_archived" query:"is_archived"`

	// The id of the file this project has set as background
	BackgroundFileID int64 `xorm:"null" json:"-"`
	// Holds extra information about the background set since some background providers require attribution or similar. If not null, the background can be accessed at /projects/{projectID}/background
	BackgroundInformation interface{} `xorm:"-" json:"background_information"`
	// Contains a very small version of the project background to use as a blurry preview until the actual background is loaded. Check out https://blurha.sh/ to learn how it works.
	BackgroundBlurHash string `xorm:"varchar(50) null" json:"background_blur_hash"`

	// True if a project is a favorite. Favorite projects show up in a separate parent project. This value depends on the user making the call to the api.
	IsFavorite bool `xorm:"-" json:"is_favorite"`

	// The subscription status for the user reading this project. You can only read this property, use the subscription endpoints to modify it.
	// Will only returned when retreiving one project.
	Subscription *Subscription `xorm:"-" json:"subscription,omitempty"`

	// The position this project has when querying all projects. See the tasks.position property on how to use this.
	Position float64 `xorm:"double null" json:"position"`

	// A timestamp when this project was created. You cannot change this value.
	Created time.Time `xorm:"created not null" json:"created"`
	// A timestamp when this project was last updated. You cannot change this value.
	Updated time.Time `xorm:"updated not null" json:"updated"`

	web.CRUDable `xorm:"-" json:"-"`
	web.Rights   `xorm:"-" json:"-"`
}

Project represents a project of tasks

func GetProjectByShareHash added in v0.21.0

func GetProjectByShareHash(s *xorm.Session, hash string) (project *Project, err error)

GetProjectByShareHash returns a link share by its hash

func GetProjectSimplByTaskID added in v0.21.0

func GetProjectSimplByTaskID(s *xorm.Session, taskID int64) (l *Project, err error)

GetProjectSimplByTaskID gets a project by a task id

func GetProjectSimpleByID added in v0.21.0

func GetProjectSimpleByID(s *xorm.Session, projectID int64) (project *Project, err error)

GetProjectSimpleByID gets a project with only the basic items, aka no tasks or user objects. Returns an error if the project does not exist.

func (*Project) CanCreate added in v0.21.0

func (p *Project) CanCreate(s *xorm.Session, a web.Auth) (bool, error)

CanCreate checks if the user can create a project

func (*Project) CanDelete added in v0.21.0

func (p *Project) CanDelete(s *xorm.Session, a web.Auth) (bool, error)

CanDelete checks if the user can delete a project

func (*Project) CanRead added in v0.21.0

func (p *Project) CanRead(s *xorm.Session, a web.Auth) (bool, int, error)

CanRead checks if a user has read access to a project

func (*Project) CanUpdate added in v0.21.0

func (p *Project) CanUpdate(s *xorm.Session, a web.Auth) (canUpdate bool, err error)

CanUpdate checks if the user can update a project

func (*Project) CanWrite added in v0.21.0

func (p *Project) CanWrite(s *xorm.Session, a web.Auth) (bool, error)

CanWrite return whether the user can write on that project or not

func (*Project) CheckIsArchived added in v0.21.0

func (p *Project) CheckIsArchived(s *xorm.Session) (err error)

CheckIsArchived returns an ErrProjectIsArchived if the project or any of its parent projects is archived.

func (*Project) Create added in v0.21.0

func (p *Project) Create(s *xorm.Session, a web.Auth) (err error)

Create implements the create method of CRUDable @Summary Creates a new project @Description Creates a new project. If a parent project is provided the user needs to have write access to that project. @tags project @Accept json @Produce json @Security JWTKeyAuth @Param project body models.Project true "The project you want to create." @Success 201 {object} models.Project "The created project." @Failure 400 {object} web.HTTPError "Invalid project object provided." @Failure 403 {object} web.HTTPError "The user does not have access to the project" @Failure 500 {object} models.Message "Internal error" @Router /projects [put]

func (*Project) Delete added in v0.21.0

func (p *Project) Delete(s *xorm.Session, a web.Auth) (err error)

Delete implements the delete method of CRUDable @Summary Deletes a project @Description Delets a project @tags project @Produce json @Security JWTKeyAuth @Param id path int true "Project ID" @Success 200 {object} models.Message "The project was successfully deleted." @Failure 400 {object} web.HTTPError "Invalid project object provided." @Failure 403 {object} web.HTTPError "The user does not have access to the project" @Failure 500 {object} models.Message "Internal error" @Router /projects/{id} [delete]

func (*Project) DeleteBackgroundFileIfExists added in v0.21.0

func (p *Project) DeleteBackgroundFileIfExists() (err error)

DeleteBackgroundFileIfExists deletes the list's background file from the db and the filesystem, if one exists

func (*Project) GetAllParentProjects added in v0.21.0

func (p *Project) GetAllParentProjects(s *xorm.Session) (err error)

GetAllParentProjects returns all parents of a given project

func (*Project) IsAdmin added in v0.21.0

func (p *Project) IsAdmin(s *xorm.Session, a web.Auth) (bool, error)

IsAdmin returns whether the user has admin rights on the project or not

func (*Project) ReadAll added in v0.21.0

func (p *Project) ReadAll(s *xorm.Session, a web.Auth, search string, page int, perPage int) (result interface{}, resultCount int, totalItems int64, err error)

ReadAll gets all projects a user has access to @Summary Get all projects a user has access to @Description Returns all projects a user has access to. @tags project @Accept json @Produce json @Param page query int false "The page number. Used for pagination. If not provided, the first page of results is returned." @Param per_page query int false "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page." @Param s query string false "Search projects by title." @Param is_archived query bool false "If true, also returns all archived projects." @Security JWTKeyAuth @Success 200 {array} models.Project "The projects" @Failure 403 {object} web.HTTPError "The user does not have access to the project" @Failure 500 {object} models.Message "Internal error" @Router /projects [get]

func (*Project) ReadOne added in v0.21.0

func (p *Project) ReadOne(s *xorm.Session, a web.Auth) (err error)

ReadOne gets one project by its ID @Summary Gets one project @Description Returns a project by its ID. @tags project @Accept json @Produce json @Security JWTKeyAuth @Param id path int true "Project ID" @Success 200 {object} models.Project "The project" @Failure 403 {object} web.HTTPError "The user does not have access to the project" @Failure 500 {object} models.Message "Internal error" @Router /projects/{id} [get]

func (*Project) TableName added in v0.21.0

func (p *Project) TableName() string

TableName returns a better name for the projects table

func (*Project) Update added in v0.21.0

func (p *Project) Update(s *xorm.Session, a web.Auth) (err error)

Update implements the update method of CRUDable @Summary Updates a project @Description Updates a project. This does not include adding a task (see below). @tags project @Accept json @Produce json @Security JWTKeyAuth @Param id path int true "Project ID" @Param project body models.Project true "The project with updated values you want to update." @Success 200 {object} models.Project "The updated project." @Failure 400 {object} web.HTTPError "Invalid project object provided." @Failure 403 {object} web.HTTPError "The user does not have access to the project" @Failure 500 {object} models.Message "Internal error" @Router /projects/{id} [post]

type ProjectBackgroundType added in v0.21.0

type ProjectBackgroundType struct {
	Type string
}

ProjectBackgroundType holds a project background type

type ProjectCreatedEvent added in v0.21.0

type ProjectCreatedEvent struct {
	Project *Project   `json:"project"`
	Doer    *user.User `json:"doer"`
}

ProjectCreatedEvent represents an event where a project has been created

func (*ProjectCreatedEvent) Name added in v0.21.0

func (l *ProjectCreatedEvent) Name() string

Name defines the name for ProjectCreatedEvent

type ProjectCreatedNotification added in v0.21.0

type ProjectCreatedNotification struct {
	Doer    *user.User `json:"doer"`
	Project *Project   `json:"project"`
}

ProjectCreatedNotification represents a ProjectCreatedNotification notification

func (*ProjectCreatedNotification) Name added in v0.21.0

Name returns the name of the notification

func (*ProjectCreatedNotification) ToDB added in v0.21.0

func (n *ProjectCreatedNotification) ToDB() interface{}

ToDB returns the ProjectCreatedNotification notification in a format which can be saved in the db

func (*ProjectCreatedNotification) ToMail added in v0.21.0

ToMail returns the mail notification for ProjectCreatedNotification

type ProjectDeletedEvent added in v0.21.0

type ProjectDeletedEvent struct {
	Project *Project `json:"project"`
	Doer    web.Auth `json:"doer"`
}

ProjectDeletedEvent represents an event where a project has been deleted

func (*ProjectDeletedEvent) Name added in v0.21.0

func (p *ProjectDeletedEvent) Name() string

Name defines the name for ProjectDeletedEvent

type ProjectDuplicate added in v0.21.0

type ProjectDuplicate struct {
	// The project id of the project to duplicate
	ProjectID int64 `json:"-" param:"projectid"`
	// The target parent project
	ParentProjectID int64 `json:"parent_project_id,omitempty"`

	// The copied project
	Project *Project `json:"duplicated_project,omitempty"`

	web.Rights   `json:"-"`
	web.CRUDable `json:"-"`
}

ProjectDuplicate holds everything needed to duplicate a project

func (*ProjectDuplicate) CanCreate added in v0.21.0

func (pd *ProjectDuplicate) CanCreate(s *xorm.Session, a web.Auth) (canCreate bool, err error)

CanCreate checks if a user has the right to duplicate a project

func (*ProjectDuplicate) Create added in v0.21.0

func (pd *ProjectDuplicate) Create(s *xorm.Session, doer web.Auth) (err error)

Create duplicates a project @Summary Duplicate an existing project @Description Copies the project, tasks, files, kanban data, assignees, comments, attachments, lables, relations, backgrounds, user/team rights and link shares from one project to a new one. The user needs read access in the project and write access in the parent of the new project. @tags project @Accept json @Produce json @Security JWTKeyAuth @Param projectID path int true "The project ID to duplicate" @Param project body models.ProjectDuplicate true "The target parent project which should hold the copied project." @Success 201 {object} models.ProjectDuplicate "The created project." @Failure 400 {object} web.HTTPError "Invalid project duplicate object provided." @Failure 403 {object} web.HTTPError "The user does not have access to the project or its parent." @Failure 500 {object} models.Message "Internal error" @Router /projects/{projectID}/duplicate [put]

type ProjectSharedWithTeamEvent added in v0.21.0

type ProjectSharedWithTeamEvent struct {
	Project *Project `json:"project"`
	Team    *Team    `json:"team"`
	Doer    web.Auth `json:"doer"`
}

ProjectSharedWithTeamEvent represents an event where a project has been shared with a team

func (*ProjectSharedWithTeamEvent) Name added in v0.21.0

Name defines the name for ProjectSharedWithTeamEvent

type ProjectSharedWithUserEvent added in v0.21.0

type ProjectSharedWithUserEvent struct {
	Project *Project   `json:"project"`
	User    *user.User `json:"user"`
	Doer    web.Auth   `json:"doer"`
}

ProjectSharedWithUserEvent represents an event where a project has been shared with a user

func (*ProjectSharedWithUserEvent) Name added in v0.21.0

Name defines the name for ProjectSharedWithUserEvent

type ProjectUIDs added in v0.21.0

type ProjectUIDs struct {
	ProjectOwnerID    int64 `xorm:"projectOwner"`
	ProjectUserID     int64 `xorm:"ulID"`
	TeamProjectUserID int64 `xorm:"tlUID"`
}

ProjectUIDs hold all kinds of user IDs from accounts who have access to a project

type ProjectUpdatedEvent added in v0.21.0

type ProjectUpdatedEvent struct {
	Project *Project `json:"project"`
	Doer    web.Auth `json:"doer"`
}

ProjectUpdatedEvent represents an event where a project has been updated

func (*ProjectUpdatedEvent) Name added in v0.21.0

func (p *ProjectUpdatedEvent) Name() string

Name defines the name for ProjectUpdatedEvent

type ProjectUser added in v0.21.0

type ProjectUser struct {
	// The unique, numeric id of this project <-> user relation.
	ID int64 `xorm:"bigint autoincr not null unique pk" json:"id"`
	// The username.
	Username string `xorm:"-" json:"user_id" param:"user"`
	// Used internally to reference the user
	UserID int64 `xorm:"bigint not null INDEX" json:"-"`
	// The project id.
	ProjectID int64 `xorm:"bigint not null INDEX" json:"-" param:"project"`
	// The right this user has. 0 = Read only, 1 = Read & Write, 2 = Admin. See the docs for more details.
	Right Right `xorm:"bigint INDEX not null default 0" json:"right" valid:"length(0|2)" maximum:"2" default:"0"`

	// A timestamp when this relation was created. You cannot change this value.
	Created time.Time `xorm:"created not null" json:"created"`
	// A timestamp when this relation was last updated. You cannot change this value.
	Updated time.Time `xorm:"updated not null" json:"updated"`

	web.CRUDable `xorm:"-" json:"-"`
	web.Rights   `xorm:"-" json:"-"`
}

ProjectUser represents a project <-> user relation

func (*ProjectUser) CanCreate added in v0.21.0

func (lu *ProjectUser) CanCreate(s *xorm.Session, a web.Auth) (bool, error)

CanCreate checks if the user can create a new user <-> project relation

func (*ProjectUser) CanDelete added in v0.21.0

func (lu *ProjectUser) CanDelete(s *xorm.Session, a web.Auth) (bool, error)

CanDelete checks if the user can delete a user <-> project relation

func (*ProjectUser) CanUpdate added in v0.21.0

func (lu *ProjectUser) CanUpdate(s *xorm.Session, a web.Auth) (bool, error)

CanUpdate checks if the user can update a user <-> project relation

func (*ProjectUser) Create added in v0.21.0

func (lu *ProjectUser) Create(s *xorm.Session, a web.Auth) (err error)

Create creates a new project <-> user relation @Summary Add a user to a project @Description Gives a user access to a project. @tags sharing @Accept json @Produce json @Security JWTKeyAuth @Param id path int true "Project ID" @Param project body models.ProjectUser true "The user you want to add to the project." @Success 201 {object} models.ProjectUser "The created user<->project relation." @Failure 400 {object} web.HTTPError "Invalid user project object provided." @Failure 404 {object} web.HTTPError "The user does not exist." @Failure 403 {object} web.HTTPError "The user does not have access to the project" @Failure 500 {object} models.Message "Internal error" @Router /projects/{id}/users [put]

func (*ProjectUser) Delete added in v0.21.0

func (lu *ProjectUser) Delete(s *xorm.Session, _ web.Auth) (err error)

Delete deletes a project <-> user relation @Summary Delete a user from a project @Description Delets a user from a project. The user won't have access to the project anymore. @tags sharing @Produce json @Security JWTKeyAuth @Param projectID path int true "Project ID" @Param userID path int true "User ID" @Success 200 {object} models.Message "The user was successfully removed from the project." @Failure 403 {object} web.HTTPError "The user does not have access to the project" @Failure 404 {object} web.HTTPError "user or project does not exist." @Failure 500 {object} models.Message "Internal error" @Router /projects/{projectID}/users/{userID} [delete]

func (*ProjectUser) ReadAll added in v0.21.0

func (lu *ProjectUser) ReadAll(s *xorm.Session, a web.Auth, search string, page int, perPage int) (result interface{}, resultCount int, numberOfTotalItems int64, err error)

ReadAll gets all users who have access to a project @Summary Get users on a project @Description Returns a project with all users which have access on a given project. @tags sharing @Accept json @Produce json @Param id path int true "Project ID" @Param page query int false "The page number. Used for pagination. If not provided, the first page of results is returned." @Param per_page query int false "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page." @Param s query string false "Search users by its name." @Security JWTKeyAuth @Success 200 {array} models.UserWithRight "The users with the right they have." @Failure 403 {object} web.HTTPError "No right to see the project." @Failure 500 {object} models.Message "Internal error" @Router /projects/{id}/users [get]

func (ProjectUser) TableName added in v0.21.0

func (ProjectUser) TableName() string

TableName is the table name for ProjectUser

func (*ProjectUser) Update added in v0.21.0

func (lu *ProjectUser) Update(s *xorm.Session, _ web.Auth) (err error)

Update updates a user <-> project relation @Summary Update a user <-> project relation @Description Update a user <-> project relation. Mostly used to update the right that user has. @tags sharing @Accept json @Produce json @Param projectID path int true "Project ID" @Param userID path int true "User ID" @Param project body models.ProjectUser true "The user you want to update." @Security JWTKeyAuth @Success 200 {object} models.ProjectUser "The updated user <-> project relation." @Failure 403 {object} web.HTTPError "The user does not have admin-access to the project" @Failure 404 {object} web.HTTPError "User or project does not exist." @Failure 500 {object} models.Message "Internal error" @Router /projects/{projectID}/users/{userID} [post]

type ProjectWithTasksAndBuckets added in v0.21.0

type ProjectWithTasksAndBuckets struct {
	Project
	ChildProjects []*ProjectWithTasksAndBuckets `xorm:"-" json:"child_projects"`

	// An array of tasks which belong to the project.
	Tasks []*TaskWithComments `xorm:"-" json:"tasks"`
	// Only used for migration.
	Buckets          []*Bucket `xorm:"-" json:"buckets"`
	BackgroundFileID int64     `xorm:"null" json:"background_file_id"`
}

type RelatedTaskMap

type RelatedTaskMap map[RelationKind][]*Task

RelatedTaskMap holds all relations of a single task, grouped by relation kind. This avoids the need for an extra type TaskWithRelation (or similar).

type RelationKind

type RelationKind string

RelationKind represents a kind of relation between to tasks

const (
	RelationKindUnknown     RelationKind = `unknown`
	RelationKindSubtask     RelationKind = `subtask`
	RelationKindParenttask  RelationKind = `parenttask`
	RelationKindRelated     RelationKind = `related`
	RelationKindDuplicateOf RelationKind = `duplicateof`
	RelationKindDuplicates  RelationKind = `duplicates`
	RelationKindBlocking    RelationKind = `blocking`
	RelationKindBlocked     RelationKind = `blocked`
	RelationKindPreceeds    RelationKind = `precedes`
	RelationKindFollows     RelationKind = `follows`
	RelationKindCopiedFrom  RelationKind = `copiedfrom`
	RelationKindCopiedTo    RelationKind = `copiedto`
)

All valid relation kinds

type ReminderDueNotification added in v0.17.0

type ReminderDueNotification struct {
	User    *user.User `json:"user,omitempty"`
	Task    *Task      `json:"task"`
	Project *Project   `json:"project"`
}

ReminderDueNotification represents a ReminderDueNotification notification

func (*ReminderDueNotification) Name added in v0.17.0

func (n *ReminderDueNotification) Name() string

Name returns the name of the notification

func (*ReminderDueNotification) ToDB added in v0.17.0

func (n *ReminderDueNotification) ToDB() interface{}

ToDB returns the ReminderDueNotification notification in a format which can be saved in the db

func (*ReminderDueNotification) ToMail added in v0.17.0

ToMail returns the mail notification for ReminderDueNotification

type ReminderRelation added in v0.21.0

type ReminderRelation string

ReminderRelation represents the date attribute of the task which a period based reminder relates to

const (
	ReminderRelationDueDate   ReminderRelation = `due_date`
	ReminderRelationStartDate ReminderRelation = `start_date`
	ReminderRelationEndDate   ReminderRelation = `end_date`
)

All valid ReminderRelations

type RemoveTaskFromTypesense added in v0.22.0

type RemoveTaskFromTypesense struct {
}

RemoveTaskFromTypesense represents a listener

func (*RemoveTaskFromTypesense) Handle added in v0.22.0

func (s *RemoveTaskFromTypesense) Handle(msg *message.Message) (err error)

Handle is executed when the event RemoveTaskFromTypesense listens on is fired

func (*RemoveTaskFromTypesense) Name added in v0.22.0

func (s *RemoveTaskFromTypesense) Name() string

Name defines the name for the RemoveTaskFromTypesense listener

type Right int

Right defines the rights users/teams can have for projects

const (
	// Can read projects in a
	RightRead Right = iota
	// Can write in a like projects and tasks. Cannot create new projects.
	RightWrite
	// Can manage a project, can do everything
	RightAdmin
)

Enumerate all the team rights

type RouteDetail added in v0.22.0

type RouteDetail struct {
	Path   string `json:"path"`
	Method string `json:"method"`
}

type SavedFilter added in v0.15.0

type SavedFilter struct {
	// The unique numeric id of this saved filter
	ID int64 `xorm:"autoincr not null unique pk" json:"id" param:"filter"`
	// The actual filters this filter contains
	Filters *TaskCollection `xorm:"JSON not null" json:"filters" valid:"required"`
	// The title of the filter.
	Title string `xorm:"varchar(250) not null" json:"title" valid:"required,runelength(1|250)" minLength:"1" maxLength:"250"`
	// The description of the filter
	Description string `xorm:"longtext null" json:"description"`
	OwnerID     int64  `xorm:"bigint not null INDEX" json:"-"`

	// The user who owns this filter
	Owner *user.User `xorm:"-" json:"owner" valid:"-"`

	// True if the filter is a favorite. Favorite filters show up in a separate parent project together with favorite projects.
	IsFavorite bool `xorm:"default false" json:"is_favorite"`

	// A timestamp when this filter was created. You cannot change this value.
	Created time.Time `xorm:"created not null" json:"created"`
	// A timestamp when this filter was last updated. You cannot change this value.
	Updated time.Time `xorm:"updated not null" json:"updated"`

	web.CRUDable `xorm:"-" json:"-"`
	web.Rights   `xorm:"-" json:"-"`
}

SavedFilter represents a saved bunch of filters

func (*SavedFilter) CanCreate added in v0.15.0

func (sf *SavedFilter) CanCreate(_ *xorm.Session, auth web.Auth) (bool, error)

CanCreate checks if a user has the right to update a saved filter

func (*SavedFilter) CanDelete added in v0.15.0

func (sf *SavedFilter) CanDelete(s *xorm.Session, auth web.Auth) (bool, error)

CanDelete checks if a user has the right to delete a saved filter

func (*SavedFilter) CanRead added in v0.15.0

func (sf *SavedFilter) CanRead(s *xorm.Session, auth web.Auth) (bool, int, error)

CanRead checks if a user has the right to read a saved filter

func (*SavedFilter) CanUpdate added in v0.15.0

func (sf *SavedFilter) CanUpdate(s *xorm.Session, auth web.Auth) (bool, error)

CanUpdate checks if a user has the right to update a saved filter

func (*SavedFilter) Create added in v0.15.0

func (sf *SavedFilter) Create(s *xorm.Session, auth web.Auth) error

Create creates a new saved filter @Summary Creates a new saved filter @Description Creates a new saved filter @tags filter @Accept json @Produce json @Security JWTKeyAuth @Success 201 {object} models.SavedFilter "The Saved Filter" @Failure 403 {object} web.HTTPError "The user does not have access to that saved filter." @Failure 500 {object} models.Message "Internal error" @Router /filters [put]

func (*SavedFilter) Delete added in v0.15.0

func (sf *SavedFilter) Delete(s *xorm.Session, _ web.Auth) error

Delete removes a saved filter @Summary Removes a saved filter @Description Removes a saved filter by its ID. @tags filter @Accept json @Produce json @Security JWTKeyAuth @Param id path int true "Filter ID" @Success 200 {object} models.SavedFilter "The Saved Filter" @Failure 403 {object} web.HTTPError "The user does not have access to that saved filter." @Failure 404 {object} web.HTTPError "The saved filter does not exist." @Failure 500 {object} models.Message "Internal error" @Router /filters/{id} [delete]

func (*SavedFilter) ReadOne added in v0.15.0

func (sf *SavedFilter) ReadOne(s *xorm.Session, _ web.Auth) error

ReadOne returns one saved filter @Summary Gets one saved filter @Description Returns a saved filter by its ID. @tags filter @Accept json @Produce json @Security JWTKeyAuth @Param id path int true "Filter ID" @Success 200 {object} models.SavedFilter "The Saved Filter" @Failure 403 {object} web.HTTPError "The user does not have access to that saved filter." @Failure 500 {object} models.Message "Internal error" @Router /filters/{id} [get]

func (*SavedFilter) TableName added in v0.15.0

func (sf *SavedFilter) TableName() string

TableName returns a better table name for saved filters

func (*SavedFilter) Update added in v0.15.0

func (sf *SavedFilter) Update(s *xorm.Session, _ web.Auth) error

Update updates an existing filter @Summary Updates a saved filter @Description Updates a saved filter by its ID. @tags filter @Accept json @Produce json @Security JWTKeyAuth @Param id path int true "Filter ID" @Success 200 {object} models.SavedFilter "The Saved Filter" @Failure 403 {object} web.HTTPError "The user does not have access to that saved filter." @Failure 404 {object} web.HTTPError "The saved filter does not exist." @Failure 500 {object} models.Message "Internal error" @Router /filters/{id} [post]

type SendProjectCreatedNotification added in v0.21.0

type SendProjectCreatedNotification struct {
}

SendProjectCreatedNotification represents a listener

func (*SendProjectCreatedNotification) Handle added in v0.21.0

func (s *SendProjectCreatedNotification) Handle(msg *message.Message) (err error)

Handle is executed when the event SendProjectCreatedNotification listens on is fired

func (*SendProjectCreatedNotification) Name added in v0.21.0

Name defines the name for the SendProjectCreatedNotification listener

type SendTaskAssignedNotification added in v0.17.0

type SendTaskAssignedNotification struct {
}

SendTaskAssignedNotification represents a listener

func (*SendTaskAssignedNotification) Handle added in v0.17.0

func (s *SendTaskAssignedNotification) Handle(msg *message.Message) (err error)

Handle is executed when the event SendTaskAssignedNotification listens on is fired

func (*SendTaskAssignedNotification) Name added in v0.17.0

Name defines the name for the SendTaskAssignedNotification listener

type SendTaskCommentNotification added in v0.17.0

type SendTaskCommentNotification struct {
}

SendTaskCommentNotification represents a listener

func (*SendTaskCommentNotification) Handle added in v0.17.0

func (s *SendTaskCommentNotification) Handle(msg *message.Message) (err error)

Handle is executed when the event SendTaskCommentNotification listens on is fired

func (*SendTaskCommentNotification) Name added in v0.17.0

Name defines the name for the SendTaskCommentNotification listener

type SendTaskDeletedNotification added in v0.17.0

type SendTaskDeletedNotification struct {
}

SendTaskDeletedNotification represents a listener

func (*SendTaskDeletedNotification) Handle added in v0.17.0

func (s *SendTaskDeletedNotification) Handle(msg *message.Message) (err error)

Handle is executed when the event SendTaskDeletedNotification listens on is fired

func (*SendTaskDeletedNotification) Name added in v0.17.0

Name defines the name for the SendTaskDeletedNotification listener

type SendTeamMemberAddedNotification added in v0.17.0

type SendTeamMemberAddedNotification struct {
}

SendTeamMemberAddedNotification represents a listener

func (*SendTeamMemberAddedNotification) Handle added in v0.17.0

func (s *SendTeamMemberAddedNotification) Handle(msg *message.Message) (err error)

Handle is executed when the event SendTeamMemberAddedNotification listens on is fired

func (*SendTeamMemberAddedNotification) Name added in v0.17.0

Name defines the name for the SendTeamMemberAddedNotification listener

type SharingType

type SharingType int

SharingType holds the sharing type

const (
	SharingTypeUnknown SharingType = iota
	SharingTypeWithoutPassword
	SharingTypeWithPassword
)

These consts represent all valid link sharing types

type Subscription added in v0.17.0

type Subscription struct {
	// The numeric ID of the subscription
	ID int64 `xorm:"autoincr not null unique pk" json:"id"`

	EntityType SubscriptionEntityType `xorm:"index not null" json:"-"`
	Entity     string                 `xorm:"-" json:"entity" param:"entity"`
	// The id of the entity to subscribe to.
	EntityID int64 `xorm:"bigint index not null" json:"entity_id" param:"entityID"`

	// The user who made this subscription
	User   *user.User `xorm:"-" json:"user"`
	UserID int64      `xorm:"bigint index not null" json:"-"`

	// A timestamp when this subscription was created. You cannot change this value.
	Created time.Time `xorm:"created not null" json:"created"`

	web.CRUDable `xorm:"-" json:"-"`
	web.Rights   `xorm:"-" json:"-"`
}

Subscription represents a subscription for an entity

func GetSubscription added in v0.17.0

func GetSubscription(s *xorm.Session, entityType SubscriptionEntityType, entityID int64, a web.Auth) (subscription *Subscription, err error)

GetSubscription returns a matching subscription for an entity and user. It will return the next parent of a subscription. That means for tasks, it will first look for a subscription for that task, if there is none it will look for a subscription on the project the task belongs to.

func (*Subscription) CanCreate added in v0.17.0

func (sb *Subscription) CanCreate(s *xorm.Session, a web.Auth) (can bool, err error)

CanCreate checks if a user can subscribe to an entity

func (*Subscription) CanDelete added in v0.17.0

func (sb *Subscription) CanDelete(s *xorm.Session, a web.Auth) (can bool, err error)

CanDelete checks if a user can delete a subscription

func (*Subscription) Create added in v0.17.0

func (sb *Subscription) Create(s *xorm.Session, auth web.Auth) (err error)

Create subscribes the current user to an entity @Summary Subscribes the current user to an entity. @Description Subscribes the current user to an entity. @tags subscriptions @Accept json @Produce json @Security JWTKeyAuth @Param entity path string true "The entity the user subscribes to. Can be either `project` or `task`." @Param entityID path string true "The numeric id of the entity to subscribe to." @Success 201 {object} models.Subscription "The subscription" @Failure 403 {object} web.HTTPError "The user does not have access to subscribe to this entity." @Failure 412 {object} web.HTTPError "The subscription already exists." @Failure 412 {object} web.HTTPError "The subscription entity is invalid." @Failure 500 {object} models.Message "Internal error" @Router /subscriptions/{entity}/{entityID} [put]

func (*Subscription) Delete added in v0.17.0

func (sb *Subscription) Delete(s *xorm.Session, auth web.Auth) (err error)

Delete unsubscribes the current user to an entity @Summary Unsubscribe the current user from an entity. @Description Unsubscribes the current user to an entity. @tags subscriptions @Accept json @Produce json @Security JWTKeyAuth @Param entity path string true "The entity the user subscribed to. Can be either `project` or `task`." @Param entityID path string true "The numeric id of the subscribed entity to." @Success 200 {object} models.Subscription "The subscription" @Failure 403 {object} web.HTTPError "The user does not have access to subscribe to this entity." @Failure 404 {object} web.HTTPError "The subscription does not exist." @Failure 500 {object} models.Message "Internal error" @Router /subscriptions/{entity}/{entityID} [delete]

func (*Subscription) TableName added in v0.17.0

func (sb *Subscription) TableName() string

TableName gives us a better tabel name for the subscriptions table

type SubscriptionEntityType added in v0.17.0

type SubscriptionEntityType int

SubscriptionEntityType represents all entities which can be subscribed to

func (SubscriptionEntityType) String added in v0.17.0

func (et SubscriptionEntityType) String() string

String returns a human-readable string of an entity

type Task

type Task struct {
	// The unique, numeric id of this task.
	ID int64 `xorm:"bigint autoincr not null unique pk" json:"id" param:"projecttask"`
	// The task text. This is what you'll see in the project.
	Title string `xorm:"TEXT not null" json:"title" valid:"minstringlength(1)" minLength:"1"`
	// The task description.
	Description string `xorm:"longtext null" json:"description"`
	// Whether a task is done or not.
	Done bool `xorm:"INDEX null" json:"done"`
	// The time when a task was marked as done.
	DoneAt time.Time `xorm:"INDEX null 'done_at'" json:"done_at"`
	// The time when the task is due.
	DueDate time.Time `xorm:"DATETIME INDEX null 'due_date'" json:"due_date"`
	// An array of reminders that are associated with this task.
	Reminders []*TaskReminder `xorm:"-" json:"reminders"`
	// The project this task belongs to.
	ProjectID int64 `xorm:"bigint INDEX not null" json:"project_id" param:"project"`
	// An amount in seconds this task repeats itself. If this is set, when marking the task as done, it will mark itself as "undone" and then increase all remindes and the due date by its amount.
	RepeatAfter int64 `xorm:"bigint INDEX null" json:"repeat_after" valid:"range(0|9223372036854775807)"`
	// Can have three possible values which will trigger when the task is marked as done: 0 = repeats after the amount specified in repeat_after, 1 = repeats all dates each months (ignoring repeat_after), 3 = repeats from the current date rather than the last set date.
	RepeatMode TaskRepeatMode `xorm:"not null default 0" json:"repeat_mode"`
	// The task priority. Can be anything you want, it is possible to sort by this later.
	Priority int64 `xorm:"bigint null" json:"priority"`
	// When this task starts.
	StartDate time.Time `xorm:"DATETIME INDEX null 'start_date'" json:"start_date" query:"-"`
	// When this task ends.
	EndDate time.Time `xorm:"DATETIME INDEX null 'end_date'" json:"end_date" query:"-"`
	// An array of users who are assigned to this task
	Assignees []*user.User `xorm:"-" json:"assignees"`
	// An array of labels which are associated with this task.
	Labels []*Label `xorm:"-" json:"labels"`
	// The task color in hex
	HexColor string `xorm:"varchar(6) null" json:"hex_color" valid:"runelength(0|7)" maxLength:"7"`
	// Determines how far a task is left from being done
	PercentDone float64 `xorm:"DOUBLE null" json:"percent_done"`

	// The task identifier, based on the project identifier and the task's index
	Identifier string `xorm:"-" json:"identifier"`
	// The task index, calculated per project
	Index int64 `xorm:"bigint not null default 0" json:"index"`

	// The UID is currently not used for anything other than CalDAV, which is why we don't expose it over json
	UID string `xorm:"varchar(250) null" json:"-"`

	// All related tasks, grouped by their relation kind
	RelatedTasks RelatedTaskMap `xorm:"-" json:"related_tasks"`

	// All attachments this task has
	Attachments []*TaskAttachment `xorm:"-" json:"attachments"`

	// If this task has a cover image, the field will return the id of the attachment that is the cover image.
	CoverImageAttachmentID int64 `xorm:"bigint default 0" json:"cover_image_attachment_id"`

	// True if a task is a favorite task. Favorite tasks show up in a separate "Important" project. This value depends on the user making the call to the api.
	IsFavorite bool `xorm:"-" json:"is_favorite"`

	// The subscription status for the user reading this task. You can only read this property, use the subscription endpoints to modify it.
	// Will only returned when retrieving one task.
	Subscription *Subscription `xorm:"-" json:"subscription,omitempty"`

	// A timestamp when this task was created. You cannot change this value.
	Created time.Time `xorm:"created not null" json:"created"`
	// A timestamp when this task was last updated. You cannot change this value.
	Updated time.Time `xorm:"updated not null" json:"updated"`

	// BucketID is the ID of the kanban bucket this task belongs to.
	BucketID int64 `xorm:"bigint null" json:"bucket_id"`

	// The position of the task - any task project can be sorted as usual by this parameter.
	// When accessing tasks via kanban buckets, this is primarily used to sort them based on a range
	// We're using a float64 here to make it possible to put any task within any two other tasks (by changing the number).
	// You would calculate the new position between two tasks with something like task3.position = (task2.position - task1.position) / 2.
	// A 64-Bit float leaves plenty of room to initially give tasks a position with 2^16 difference to the previous task
	// which also leaves a lot of room for rearranging and sorting later.
	Position float64 `xorm:"double null" json:"position"`
	// The position of tasks in the kanban board. See the docs for the `position` property on how to use this.
	KanbanPosition float64 `xorm:"double null" json:"kanban_position"`

	// The user who initially created the task.
	CreatedBy   *user.User `xorm:"-" json:"created_by" valid:"-"`
	CreatedByID int64      `xorm:"bigint not null" json:"-"` // ID of the user who put that task on the project

	web.CRUDable `xorm:"-" json:"-"`
	web.Rights   `xorm:"-" json:"-"`
}

Task represents an task in a project

func GetTaskByIDSimple

func GetTaskByIDSimple(s *xorm.Session, taskID int64) (task Task, err error)

GetTaskByIDSimple returns a raw task without extra data by the task ID

func GetTaskSimple

func GetTaskSimple(s *xorm.Session, t *Task) (task Task, err error)

GetTaskSimple returns a raw task without extra data

func GetTaskSimpleByUUID added in v0.22.0

func GetTaskSimpleByUUID(s *xorm.Session, uid string) (task *Task, err error)

func GetTasksByUIDs

func GetTasksByUIDs(s *xorm.Session, uids []string, a web.Auth) (tasks []*Task, err error)

GetTasksByUIDs gets all tasks from a bunch of uids

func (*Task) CanCreate

func (t *Task) CanCreate(s *xorm.Session, a web.Auth) (bool, error)

CanCreate determines if a user has the right to create a project task

func (*Task) CanDelete

func (t *Task) CanDelete(s *xorm.Session, a web.Auth) (bool, error)

CanDelete checks if the user can delete an task

func (*Task) CanRead

func (t *Task) CanRead(s *xorm.Session, a web.Auth) (canRead bool, maxRight int, err error)

CanRead determines if a user can read a task

func (*Task) CanUpdate

func (t *Task) CanUpdate(s *xorm.Session, a web.Auth) (bool, error)

CanUpdate determines if a user has the right to update a project task

func (*Task) CanWrite

func (t *Task) CanWrite(s *xorm.Session, a web.Auth) (canWrite bool, err error)

CanWrite checks if a user has write access to a task

func (*Task) Create

func (t *Task) Create(s *xorm.Session, a web.Auth) (err error)

Create is the implementation to create a project task @Summary Create a task @Description Inserts a task into a project. @tags task @Accept json @Produce json @Security JWTKeyAuth @Param id path int true "Project ID" @Param task body models.Task true "The task object" @Success 201 {object} models.Task "The created task object." @Failure 400 {object} web.HTTPError "Invalid task object provided." @Failure 403 {object} web.HTTPError "The user does not have access to the project" @Failure 500 {object} models.Message "Internal error" @Router /projects/{id}/tasks [put]

func (*Task) Delete

func (t *Task) Delete(s *xorm.Session, a web.Auth) (err error)

Delete implements the delete method for a task @Summary Delete a task @Description Deletes a task from a project. This does not mean "mark it done". @tags task @Produce json @Security JWTKeyAuth @Param id path int true "Task ID" @Success 200 {object} models.Message "The created task object." @Failure 400 {object} web.HTTPError "Invalid task ID provided." @Failure 403 {object} web.HTTPError "The user does not have access to the project" @Failure 500 {object} models.Message "Internal error" @Router /tasks/{id} [delete]

func (*Task) GetFrontendURL added in v0.17.0

func (t *Task) GetFrontendURL() string

func (*Task) GetFullIdentifier added in v0.17.0

func (t *Task) GetFullIdentifier() string

GetFullIdentifier returns the task identifier if the task has one and the index prefixed with # otherwise.

func (*Task) ReadAll

func (t *Task) ReadAll(_ *xorm.Session, _ web.Auth, _ string, _ int, _ int) (result interface{}, resultCount int, totalItems int64, err error)

ReadAll is a dummy function to still have that endpoint documented @Summary Get tasks @Description Returns all tasks on any project the user has access to. @tags task @Accept json @Produce json @Param page query int false "The page number. Used for pagination. If not provided, the first page of results is returned." @Param per_page query int false "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page." @Param s query string false "Search tasks by task text." @Param sort_by query string false "The sorting parameter. You can pass this multiple times to get the tasks ordered by multiple different parameters, along with `order_by`. Possible values to sort by are `id`, `title`, `description`, `done`, `done_at`, `due_date`, `created_by_id`, `project_id`, `repeat_after`, `priority`, `start_date`, `end_date`, `hex_color`, `percent_done`, `uid`, `created`, `updated`. Default is `id`." @Param order_by query string false "The ordering parameter. Possible values to order by are `asc` or `desc`. Default is `asc`." @Param filter_by query string false "The name of the field to filter by. Allowed values are all task properties. Task properties which are their own object require passing in the id of that entity. Accepts an array for multiple filters which will be chanied together, all supplied filter must match." @Param filter_value query string false "The value to filter for." @Param filter_comparator query string false "The comparator to use for a filter. Available values are `equals`, `greater`, `greater_equals`, `less`, `less_equals`, `like` and `in`. `in` expects comma-separated values in `filter_value`. Defaults to `equals`" @Param filter_concat query string false "The concatinator to use for filters. Available values are `and` or `or`. Defaults to `or`." @Param filter_include_nulls query string false "If set to true the result will include filtered fields whose value is set to `null`. Available values are `true` or `false`. Defaults to `false`." @Security JWTKeyAuth @Success 200 {array} models.Task "The tasks" @Failure 500 {object} models.Message "Internal error" @Router /tasks/all [get]

func (*Task) ReadOne

func (t *Task) ReadOne(s *xorm.Session, a web.Auth) (err error)

ReadOne gets one task by its ID @Summary Get one task @Description Returns one task by its ID @tags task @Accept json @Produce json @Param id path int true "The task ID" @Security JWTKeyAuth @Success 200 {object} models.Task "The task" @Failure 404 {object} models.Message "Task not found" @Failure 500 {object} models.Message "Internal error" @Router /tasks/{id} [get]

func (*Task) TableName

func (*Task) TableName() string

TableName returns the table name for tasks

func (*Task) Update

func (t *Task) Update(s *xorm.Session, a web.Auth) (err error)

Update updates a project task @Summary Update a task @Description Updates a task. This includes marking it as done. Assignees you pass will be updated, see their individual endpoints for more details on how this is done. To update labels, see the description of the endpoint. @tags task @Accept json @Produce json @Security JWTKeyAuth @Param id path int true "The Task ID" @Param task body models.Task true "The task object" @Success 200 {object} models.Task "The updated task object." @Failure 400 {object} web.HTTPError "Invalid task object provided." @Failure 403 {object} web.HTTPError "The user does not have access to the task (aka its project)" @Failure 500 {object} models.Message "Internal error" @Router /tasks/{id} [post]

func (*Task) UpdateTaskLabels added in v0.20.3

func (t *Task) UpdateTaskLabels(s *xorm.Session, creator web.Auth, labels []*Label) (err error)

Create or update a bunch of task labels

type TaskAssginee

type TaskAssginee struct {
	ID      int64     `xorm:"bigint autoincr not null unique pk" json:"-"`
	TaskID  int64     `xorm:"bigint INDEX not null" json:"-" param:"projecttask"`
	UserID  int64     `xorm:"bigint INDEX not null" json:"user_id" param:"user"`
	Created time.Time `xorm:"created not null"`

	web.CRUDable `xorm:"-" json:"-"`
	web.Rights   `xorm:"-" json:"-"`
}

TaskAssginee represents an assignment of a user to a task

func (*TaskAssginee) CanCreate

func (la *TaskAssginee) CanCreate(s *xorm.Session, a web.Auth) (bool, error)

CanCreate checks if a user can add a new assignee

func (*TaskAssginee) CanDelete

func (la *TaskAssginee) CanDelete(s *xorm.Session, a web.Auth) (bool, error)

CanDelete checks if a user can delete an assignee

func (*TaskAssginee) Create

func (la *TaskAssginee) Create(s *xorm.Session, a web.Auth) (err error)

Create adds a new assignee to a task @Summary Add a new assignee to a task @Description Adds a new assignee to a task. The assignee needs to have access to the project, the doer must be able to edit this task. @tags assignees @Accept json @Produce json @Security JWTKeyAuth @Param assignee body models.TaskAssginee true "The assingee object" @Param taskID path int true "Task ID" @Success 201 {object} models.TaskAssginee "The created assingee object." @Failure 400 {object} web.HTTPError "Invalid assignee object provided." @Failure 500 {object} models.Message "Internal error" @Router /tasks/{taskID}/assignees [put]

func (*TaskAssginee) Delete

func (la *TaskAssginee) Delete(s *xorm.Session, a web.Auth) (err error)

Delete a task assignee @Summary Delete an assignee @Description Un-assign a user from a task. @tags assignees @Accept json @Produce json @Security JWTKeyAuth @Param taskID path int true "Task ID" @Param userID path int true "Assignee user ID" @Success 200 {object} models.Message "The assignee was successfully deleted." @Failure 403 {object} web.HTTPError "Not allowed to delete the assignee." @Failure 500 {object} models.Message "Internal error" @Router /tasks/{taskID}/assignees/{userID} [delete]

func (*TaskAssginee) ReadAll

func (la *TaskAssginee) ReadAll(s *xorm.Session, a web.Auth, search string, page int, perPage int) (result interface{}, resultCount int, numberOfTotalItems int64, err error)

ReadAll gets all assignees for a task @Summary Get all assignees for a task @Description Returns an array with all assignees for this task. @tags assignees @Accept json @Produce json @Param page query int false "The page number. Used for pagination. If not provided, the first page of results is returned." @Param per_page query int false "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page." @Param s query string false "Search assignees by their username." @Param taskID path int true "Task ID" @Security JWTKeyAuth @Success 200 {array} user.User "The assignees" @Failure 500 {object} models.Message "Internal error" @Router /tasks/{taskID}/assignees [get]

func (TaskAssginee) TableName

func (TaskAssginee) TableName() string

TableName makes a pretty table name

type TaskAssignedNotification added in v0.17.0

type TaskAssignedNotification struct {
	Doer     *user.User `json:"doer"`
	Task     *Task      `json:"task"`
	Assignee *user.User `json:"assignee"`
	Target   *user.User `json:"-"`
}

TaskAssignedNotification represents a TaskAssignedNotification notification

func (*TaskAssignedNotification) Name added in v0.17.0

func (n *TaskAssignedNotification) Name() string

Name returns the name of the notification

func (*TaskAssignedNotification) ToDB added in v0.17.0

func (n *TaskAssignedNotification) ToDB() interface{}

ToDB returns the TaskAssignedNotification notification in a format which can be saved in the db

func (*TaskAssignedNotification) ToMail added in v0.17.0

ToMail returns the mail notification for TaskAssignedNotification

type TaskAssigneeCreatedEvent added in v0.17.0

type TaskAssigneeCreatedEvent struct {
	Task     *Task      `json:"task"`
	Assignee *user.User `json:"assignee"`
	Doer     *user.User `json:"doer"`
}

TaskAssigneeCreatedEvent represents an event where a task has been assigned to a user

func (*TaskAssigneeCreatedEvent) Name added in v0.17.0

func (t *TaskAssigneeCreatedEvent) Name() string

Name defines the name for TaskAssigneeCreatedEvent

type TaskAssigneeDeletedEvent added in v0.20.3

type TaskAssigneeDeletedEvent struct {
	Task     *Task      `json:"task"`
	Assignee *user.User `json:"assignee"`
	Doer     *user.User `json:"doer"`
}

TaskAssigneeDeletedEvent represents a TaskAssigneeDeletedEvent event

func (*TaskAssigneeDeletedEvent) Name added in v0.20.3

func (t *TaskAssigneeDeletedEvent) Name() string

Name defines the name for TaskAssigneeDeletedEvent

type TaskAssigneeWithUser

type TaskAssigneeWithUser struct {
	TaskID    int64
	user.User `xorm:"extends"`
}

TaskAssigneeWithUser is a helper type to deal with user joins

type TaskAttachment

type TaskAttachment struct {
	ID     int64 `xorm:"bigint autoincr not null unique pk" json:"id" param:"attachment"`
	TaskID int64 `xorm:"bigint not null" json:"task_id" param:"task"`
	FileID int64 `xorm:"bigint not null" json:"-"`

	CreatedByID int64      `xorm:"bigint not null" json:"-"`
	CreatedBy   *user.User `xorm:"-" json:"created_by"`

	File *files.File `xorm:"-" json:"file"`

	Created time.Time `xorm:"created" json:"created"`

	web.CRUDable `xorm:"-" json:"-"`
	web.Rights   `xorm:"-" json:"-"`
}

TaskAttachment is the definition of a task attachment

func (*TaskAttachment) CanCreate

func (ta *TaskAttachment) CanCreate(s *xorm.Session, a web.Auth) (bool, error)

CanCreate checks if the user can create an attachment

func (*TaskAttachment) CanDelete

func (ta *TaskAttachment) CanDelete(s *xorm.Session, a web.Auth) (bool, error)

CanDelete checks if the user can delete an attachment

func (*TaskAttachment) CanRead

func (ta *TaskAttachment) CanRead(s *xorm.Session, a web.Auth) (bool, int, error)

CanRead checks if the user can see an attachment

func (*TaskAttachment) Delete

func (ta *TaskAttachment) Delete(s *xorm.Session, a web.Auth) error

Delete removes an attachment @Summary Delete an attachment @Description Delete an attachment. @tags task @Accept json @Produce json @Param id path int true "Task ID" @Param attachmentID path int true "Attachment ID" @Security JWTKeyAuth @Success 200 {object} models.Message "The attachment was deleted successfully." @Failure 403 {object} models.Message "No access to this task." @Failure 404 {object} models.Message "The task does not exist." @Failure 500 {object} models.Message "Internal error" @Router /tasks/{id}/attachments/{attachmentID} [delete]

func (*TaskAttachment) NewAttachment

func (ta *TaskAttachment) NewAttachment(s *xorm.Session, f io.ReadCloser, realname string, realsize uint64, a web.Auth) error

NewAttachment creates a new task attachment Note: I'm not sure if only accepting an io.ReadCloser and not an afero.File or os.File instead is a good way of doing things.

func (*TaskAttachment) ReadAll

func (ta *TaskAttachment) ReadAll(s *xorm.Session, _ web.Auth, _ string, page int, perPage int) (result interface{}, resultCount int, numberOfTotalItems int64, err error)

ReadAll returns a project with all attachments @Summary Get all attachments for one task. @Description Get all task attachments for one task. @tags task @Accept json @Produce json @Param id path int true "Task ID" @Param page query int false "The page number. Used for pagination. If not provided, the first page of results is returned." @Param per_page query int false "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page." @Security JWTKeyAuth @Success 200 {array} models.TaskAttachment "All attachments for this task" @Failure 403 {object} models.Message "No access to this task." @Failure 404 {object} models.Message "The task does not exist." @Failure 500 {object} models.Message "Internal error" @Router /tasks/{id}/attachments [get]

func (*TaskAttachment) ReadOne

func (ta *TaskAttachment) ReadOne(s *xorm.Session, _ web.Auth) (err error)

ReadOne returns a task attachment

func (*TaskAttachment) TableName

func (*TaskAttachment) TableName() string

TableName returns the table name for task attachments

type TaskAttachmentCreatedEvent added in v0.20.3

type TaskAttachmentCreatedEvent struct {
	Task       *Task           `json:"task"`
	Attachment *TaskAttachment `json:"attachment"`
	Doer       *user.User      `json:"doer"`
}

TaskAttachmentCreatedEvent represents a TaskAttachmentCreatedEvent event

func (*TaskAttachmentCreatedEvent) Name added in v0.20.3

Name defines the name for TaskAttachmentCreatedEvent

type TaskAttachmentDeletedEvent added in v0.20.3

type TaskAttachmentDeletedEvent struct {
	Task       *Task           `json:"task"`
	Attachment *TaskAttachment `json:"attachment"`
	Doer       *user.User      `json:"doer"`
}

TaskAttachmentDeletedEvent represents a TaskAttachmentDeletedEvent event

func (*TaskAttachmentDeletedEvent) Name added in v0.20.3

Name defines the name for TaskAttachmentDeletedEvent

type TaskCollection

type TaskCollection struct {
	ProjectID int64 `param:"project" json:"-"`

	// The query parameter to sort by. This is for ex. done, priority, etc.
	SortBy    []string `query:"sort_by" json:"sort_by"`
	SortByArr []string `query:"sort_by[]" json:"-"`
	// The query parameter to order the items by. This can be either asc or desc, with asc being the default.
	OrderBy    []string `query:"order_by" json:"order_by"`
	OrderByArr []string `query:"order_by[]" json:"-"`

	// The field name of the field to filter by
	FilterBy    []string `query:"filter_by" json:"filter_by"`
	FilterByArr []string `query:"filter_by[]" json:"-"`
	// The value of the field name to filter by
	FilterValue    []string `query:"filter_value" json:"filter_value"`
	FilterValueArr []string `query:"filter_value[]" json:"-"`
	// The comparator for field and value
	FilterComparator    []string `query:"filter_comparator" json:"filter_comparator"`
	FilterComparatorArr []string `query:"filter_comparator[]" json:"-"`
	// The way all filter conditions are concatenated together, can be either "and" or "or".,
	FilterConcat string `query:"filter_concat" json:"filter_concat"`
	// If set to true, the result will also include null values
	FilterIncludeNulls bool `query:"filter_include_nulls" json:"filter_include_nulls"`

	web.CRUDable `xorm:"-" json:"-"`
	web.Rights   `xorm:"-" json:"-"`
}

TaskCollection is a struct used to hold filter details and not clutter the Task struct with information not related to actual tasks.

func (*TaskCollection) ReadAll

func (tf *TaskCollection) ReadAll(s *xorm.Session, a web.Auth, search string, page int, perPage int) (result interface{}, resultCount int, totalItems int64, err error)

ReadAll gets all tasks for a collection @Summary Get tasks in a project @Description Returns all tasks for the current project. @tags task @Accept json @Produce json @Param id path int true "The project ID." @Param page query int false "The page number. Used for pagination. If not provided, the first page of results is returned." @Param per_page query int false "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page." @Param s query string false "Search tasks by task text." @Param sort_by query string false "The sorting parameter. You can pass this multiple times to get the tasks ordered by multiple different parametes, along with `order_by`. Possible values to sort by are `id`, `title`, `description`, `done`, `done_at`, `due_date`, `created_by_id`, `project_id`, `repeat_after`, `priority`, `start_date`, `end_date`, `hex_color`, `percent_done`, `uid`, `created`, `updated`. Default is `id`." @Param order_by query string false "The ordering parameter. Possible values to order by are `asc` or `desc`. Default is `asc`." @Param filter_by query string false "The name of the field to filter by. Allowed values are all task properties. Task properties which are their own object require passing in the id of that entity. Accepts an array for multiple filters which will be chanied together, all supplied filter must match." @Param filter_value query string false "The value to filter for. You can use [grafana](https://grafana.com/docs/grafana/latest/dashboards/time-range-controls)- or [elasticsearch](https://www.elastic.co/guide/en/elasticsearch/reference/7.3/common-options.html#date-math)-style relative dates for all date fields like `due_date`, `start_date`, `end_date`, etc." @Param filter_comparator query string false "The comparator to use for a filter. Available values are `equals`, `greater`, `greater_equals`, `less`, `less_equals`, `like` and `in`. `in` expects comma-separated values in `filter_value`. Defaults to `equals`" @Param filter_concat query string false "The concatinator to use for filters. Available values are `and` or `or`. Defaults to `or`." @Param filter_include_nulls query string false "If set to true the result will include filtered fields whose value is set to `null`. Available values are `true` or `false`. Defaults to `false`." @Security JWTKeyAuth @Success 200 {array} models.Task "The tasks" @Failure 500 {object} models.Message "Internal error" @Router /projects/{id}/tasks [get]

type TaskComment

type TaskComment struct {
	ID       int64      `xorm:"autoincr pk unique not null" json:"id" param:"commentid"`
	Comment  string     `xorm:"text not null" json:"comment"`
	AuthorID int64      `xorm:"not null" json:"-"`
	Author   *user.User `xorm:"-" json:"author"`
	TaskID   int64      `xorm:"not null" json:"-" param:"task"`

	Created time.Time `xorm:"created" json:"created"`
	Updated time.Time `xorm:"updated" json:"updated"`

	web.CRUDable `xorm:"-" json:"-"`
	web.Rights   `xorm:"-" json:"-"`
}

TaskComment represents a task comment

func (*TaskComment) CanCreate

func (tc *TaskComment) CanCreate(s *xorm.Session, a web.Auth) (bool, error)

CanCreate checks if a user can create a new comment

func (*TaskComment) CanDelete

func (tc *TaskComment) CanDelete(s *xorm.Session, a web.Auth) (bool, error)

CanDelete checks if a user can delete a comment

func (*TaskComment) CanRead

func (tc *TaskComment) CanRead(s *xorm.Session, a web.Auth) (bool, int, error)

CanRead checks if a user can read a comment

func (*TaskComment) CanUpdate

func (tc *TaskComment) CanUpdate(s *xorm.Session, a web.Auth) (bool, error)

CanUpdate checks if a user can update a comment

func (*TaskComment) Create

func (tc *TaskComment) Create(s *xorm.Session, a web.Auth) (err error)

Create creates a new task comment @Summary Create a new task comment @Description Create a new task comment. The user doing this need to have at least write access to the task this comment should belong to. @tags task @Accept json @Produce json @Security JWTKeyAuth @Param relation body models.TaskComment true "The task comment object" @Param taskID path int true "Task ID" @Success 201 {object} models.TaskComment "The created task comment object." @Failure 400 {object} web.HTTPError "Invalid task comment object provided." @Failure 500 {object} models.Message "Internal error" @Router /tasks/{taskID}/comments [put]

func (*TaskComment) Delete

func (tc *TaskComment) Delete(s *xorm.Session, _ web.Auth) error

Delete removes a task comment @Summary Remove a task comment @Description Remove a task comment. The user doing this need to have at least write access to the task this comment belongs to. @tags task @Accept json @Produce json @Security JWTKeyAuth @Param taskID path int true "Task ID" @Param commentID path int true "Comment ID" @Success 200 {object} models.Message "The task comment was successfully deleted." @Failure 400 {object} web.HTTPError "Invalid task comment object provided." @Failure 404 {object} web.HTTPError "The task comment was not found." @Failure 500 {object} models.Message "Internal error" @Router /tasks/{taskID}/comments/{commentID} [delete]

func (*TaskComment) ReadAll

func (tc *TaskComment) ReadAll(s *xorm.Session, auth web.Auth, search string, page int, perPage int) (result interface{}, resultCount int, numberOfTotalItems int64, err error)

ReadAll returns all comments for a task @Summary Get all task comments @Description Get all task comments. The user doing this need to have at least read access to the task. @tags task @Accept json @Produce json @Security JWTKeyAuth @Param taskID path int true "Task ID" @Success 200 {array} models.TaskComment "The array with all task comments" @Failure 500 {object} models.Message "Internal error" @Router /tasks/{taskID}/comments [get]

func (*TaskComment) ReadOne

func (tc *TaskComment) ReadOne(s *xorm.Session, _ web.Auth) (err error)

ReadOne handles getting a single comment @Summary Remove a task comment @Description Remove a task comment. The user doing this need to have at least read access to the task this comment belongs to. @tags task @Accept json @Produce json @Security JWTKeyAuth @Param taskID path int true "Task ID" @Param commentID path int true "Comment ID" @Success 200 {object} models.TaskComment "The task comment object." @Failure 400 {object} web.HTTPError "Invalid task comment object provided." @Failure 404 {object} web.HTTPError "The task comment was not found." @Failure 500 {object} models.Message "Internal error" @Router /tasks/{taskID}/comments/{commentID} [get]

func (*TaskComment) TableName

func (tc *TaskComment) TableName() string

TableName holds the table name for the task comments table

func (*TaskComment) Update

func (tc *TaskComment) Update(s *xorm.Session, _ web.Auth) error

Update updates a task text by its ID @Summary Update an existing task comment @Description Update an existing task comment. The user doing this need to have at least write access to the task this comment belongs to. @tags task @Accept json @Produce json @Security JWTKeyAuth @Param taskID path int true "Task ID" @Param commentID path int true "Comment ID" @Success 200 {object} models.TaskComment "The updated task comment object." @Failure 400 {object} web.HTTPError "Invalid task comment object provided." @Failure 404 {object} web.HTTPError "The task comment was not found." @Failure 500 {object} models.Message "Internal error" @Router /tasks/{taskID}/comments/{commentID} [post]

type TaskCommentCreatedEvent added in v0.17.0

type TaskCommentCreatedEvent struct {
	Task    *Task        `json:"task"`
	Comment *TaskComment `json:"comment"`
	Doer    *user.User   `json:"doer"`
}

TaskCommentCreatedEvent represents an event where a task comment has been created

func (*TaskCommentCreatedEvent) Name added in v0.17.0

func (t *TaskCommentCreatedEvent) Name() string

Name defines the name for TaskCommentCreatedEvent

type TaskCommentDeletedEvent added in v0.20.3

type TaskCommentDeletedEvent struct {
	Task    *Task        `json:"task"`
	Comment *TaskComment `json:"comment"`
	Doer    *user.User   `json:"doer"`
}

TaskCommentDeletedEvent represents a TaskCommentDeletedEvent event

func (*TaskCommentDeletedEvent) Name added in v0.20.3

func (t *TaskCommentDeletedEvent) Name() string

Name defines the name for TaskCommentDeletedEvent

type TaskCommentNotification added in v0.17.0

type TaskCommentNotification struct {
	Doer      *user.User   `json:"doer"`
	Task      *Task        `json:"task"`
	Comment   *TaskComment `json:"comment"`
	Mentioned bool         `json:"mentioned"`
}

TaskCommentNotification represents a TaskCommentNotification notification

func (*TaskCommentNotification) Name added in v0.17.0

func (n *TaskCommentNotification) Name() string

Name returns the name of the notification

func (*TaskCommentNotification) SubjectID added in v0.18.0

func (n *TaskCommentNotification) SubjectID() int64

func (*TaskCommentNotification) ToDB added in v0.17.0

func (n *TaskCommentNotification) ToDB() interface{}

ToDB returns the TaskCommentNotification notification in a format which can be saved in the db

func (*TaskCommentNotification) ToMail added in v0.17.0

ToMail returns the mail notification for TaskCommentNotification

type TaskCommentUpdatedEvent added in v0.18.0

type TaskCommentUpdatedEvent struct {
	Task    *Task        `json:"task"`
	Comment *TaskComment `json:"comment"`
	Doer    *user.User   `json:"doer"`
}

TaskCommentUpdatedEvent represents a TaskCommentUpdatedEvent event

func (*TaskCommentUpdatedEvent) Name added in v0.18.0

func (t *TaskCommentUpdatedEvent) Name() string

Name defines the name for TaskCommentUpdatedEvent

type TaskCreatedEvent added in v0.17.0

type TaskCreatedEvent struct {
	Task *Task      `json:"task"`
	Doer *user.User `json:"doer"`
}

TaskCreatedEvent represents an event where a task has been created

func (*TaskCreatedEvent) Name added in v0.17.0

func (t *TaskCreatedEvent) Name() string

Name defines the name for TaskCreatedEvent

type TaskDeletedEvent added in v0.17.0

type TaskDeletedEvent struct {
	Task *Task      `json:"task"`
	Doer *user.User `json:"doer"`
}

TaskDeletedEvent represents a TaskDeletedEvent event

func (*TaskDeletedEvent) Name added in v0.17.0

func (t *TaskDeletedEvent) Name() string

Name defines the name for TaskDeletedEvent

type TaskDeletedNotification added in v0.17.0

type TaskDeletedNotification struct {
	Doer *user.User `json:"doer"`
	Task *Task      `json:"task"`
}

TaskDeletedNotification represents a TaskDeletedNotification notification

func (*TaskDeletedNotification) Name added in v0.17.0

func (n *TaskDeletedNotification) Name() string

Name returns the name of the notification

func (*TaskDeletedNotification) ToDB added in v0.17.0

func (n *TaskDeletedNotification) ToDB() interface{}

ToDB returns the TaskDeletedNotification notification in a format which can be saved in the db

func (*TaskDeletedNotification) ToMail added in v0.17.0

ToMail returns the mail notification for TaskDeletedNotification

type TaskRelation

type TaskRelation struct {
	// The unique, numeric id of this relation.
	ID int64 `xorm:"bigint autoincr not null unique pk" json:"-"`
	// The ID of the "base" task, the task which has a relation to another.
	TaskID int64 `xorm:"bigint not null" json:"task_id" param:"task"`
	// The ID of the other task, the task which is being related.
	OtherTaskID int64 `xorm:"bigint not null" json:"other_task_id" param:"otherTask"`
	// The kind of the relation.
	RelationKind RelationKind `xorm:"varchar(50) not null" json:"relation_kind" param:"relationKind"`

	CreatedByID int64 `xorm:"bigint not null" json:"-"`
	// The user who created this relation
	CreatedBy *user.User `xorm:"-" json:"created_by"`

	// A timestamp when this label was created. You cannot change this value.
	Created time.Time `xorm:"created not null" json:"created"`

	web.CRUDable `xorm:"-" json:"-"`
	web.Rights   `xorm:"-" json:"-"`
}

TaskRelation represents a kind of relation between two tasks

func (*TaskRelation) CanCreate

func (rel *TaskRelation) CanCreate(s *xorm.Session, a web.Auth) (bool, error)

CanCreate checks if a user can create a new relation between two relations

func (*TaskRelation) CanDelete

func (rel *TaskRelation) CanDelete(s *xorm.Session, a web.Auth) (bool, error)

CanDelete checks if a user can delete a task relation

func (*TaskRelation) Create

func (rel *TaskRelation) Create(s *xorm.Session, a web.Auth) error

Create creates a new task relation @Summary Create a new relation between two tasks @Description Creates a new relation between two tasks. The user needs to have update rights on the base task and at least read rights on the other task. Both tasks do not need to be on the same project. Take a look at the docs for available task relation kinds. @tags task @Accept json @Produce json @Security JWTKeyAuth @Param relation body models.TaskRelation true "The relation object" @Param taskID path int true "Task ID" @Success 201 {object} models.TaskRelation "The created task relation object." @Failure 400 {object} web.HTTPError "Invalid task relation object provided." @Failure 500 {object} models.Message "Internal error" @Router /tasks/{taskID}/relations [put]

func (*TaskRelation) Delete

func (rel *TaskRelation) Delete(s *xorm.Session, a web.Auth) error

Delete removes a task relation @Summary Remove a task relation @tags task @Accept json @Produce json @Security JWTKeyAuth @Param relation body models.TaskRelation true "The relation object" @Param taskID path int true "Task ID" @Param relationKind path string true "The kind of the relation. See the TaskRelation type for more info." @Param otherTaskID path int true "The id of the other task." @Success 200 {object} models.Message "The task relation was successfully deleted." @Failure 400 {object} web.HTTPError "Invalid task relation object provided." @Failure 404 {object} web.HTTPError "The task relation was not found." @Failure 500 {object} models.Message "Internal error" @Router /tasks/{taskID}/relations/{relationKind}/{otherTaskID} [delete]

func (*TaskRelation) TableName

func (*TaskRelation) TableName() string

TableName holds the table name for the task relation table

type TaskRelationCreatedEvent added in v0.20.3

type TaskRelationCreatedEvent struct {
	Task     *Task         `json:"task"`
	Relation *TaskRelation `json:"relation"`
	Doer     *user.User    `json:"doer"`
}

TaskRelationCreatedEvent represents a TaskRelationCreatedEvent event

func (*TaskRelationCreatedEvent) Name added in v0.20.3

func (t *TaskRelationCreatedEvent) Name() string

Name defines the name for TaskRelationCreatedEvent

type TaskRelationDeletedEvent added in v0.20.3

type TaskRelationDeletedEvent struct {
	Task     *Task         `json:"task"`
	Relation *TaskRelation `json:"relation"`
	Doer     *user.User    `json:"doer"`
}

TaskRelationDeletedEvent represents a TaskRelationDeletedEvent event

func (*TaskRelationDeletedEvent) Name added in v0.20.3

func (t *TaskRelationDeletedEvent) Name() string

Name defines the name for TaskRelationDeletedEvent

type TaskReminder

type TaskReminder struct {
	ID     int64 `xorm:"bigint autoincr not null unique pk" json:"-"`
	TaskID int64 `xorm:"bigint not null INDEX" json:"-"`
	// The absolute time when the user wants to be reminded of the task.
	Reminder time.Time `xorm:"DATETIME not null INDEX 'reminder'" json:"reminder"`
	Created  time.Time `xorm:"created not null" json:"-"`
	// A period in seconds relative to another date argument. Negative values mean the reminder triggers before the date. Default: 0, tiggers when RelativeTo is due.
	RelativePeriod int64 `xorm:"bigint null" json:"relative_period"`
	// The name of the date field to which the relative period refers to.
	RelativeTo ReminderRelation `xorm:"varchar(50) null" json:"relative_to"`
}

TaskReminder holds a reminder on a task. If RelativeTo and the assciated date field are defined, then the attribute Reminder will be computed. If RelativeTo is missing, than Reminder must be given.

func (TaskReminder) TableName

func (TaskReminder) TableName() string

TableName returns a pretty table name

type TaskRepeatMode added in v0.17.0

type TaskRepeatMode int
const (
	TaskRepeatModeDefault TaskRepeatMode = iota
	TaskRepeatModeMonth
	TaskRepeatModeFromCurrentDate
)

type TaskUpdatedEvent added in v0.17.0

type TaskUpdatedEvent struct {
	Task *Task      `json:"task"`
	Doer *user.User `json:"doer"`
}

TaskUpdatedEvent represents an event where a task has been updated

func (*TaskUpdatedEvent) Name added in v0.17.0

func (t *TaskUpdatedEvent) Name() string

Name defines the name for TaskUpdatedEvent

type TaskWithComments added in v0.18.0

type TaskWithComments struct {
	Task
	Comments []*TaskComment `xorm:"-" json:"comments"`
}

type Team

type Team struct {
	// The unique, numeric id of this team.
	ID int64 `xorm:"bigint autoincr not null unique pk" json:"id" param:"team"`
	// The name of this team.
	Name string `xorm:"varchar(250) not null" json:"name" valid:"required,runelength(1|250)" minLength:"1" maxLength:"250"`
	// The team's description.
	Description string `xorm:"longtext null" json:"description"`
	CreatedByID int64  `xorm:"bigint not null INDEX" json:"-"`

	// The user who created this team.
	CreatedBy *user.User `xorm:"-" json:"created_by"`
	// An array of all members in this team.
	Members []*TeamUser `xorm:"-" json:"members"`

	// A timestamp when this relation was created. You cannot change this value.
	Created time.Time `xorm:"created" json:"created"`
	// A timestamp when this relation was last updated. You cannot change this value.
	Updated time.Time `xorm:"updated" json:"updated"`

	web.CRUDable `xorm:"-" json:"-"`
	web.Rights   `xorm:"-" json:"-"`
}

Team holds a team object

func GetTeamByID

func GetTeamByID(s *xorm.Session, id int64) (team *Team, err error)

GetTeamByID gets a team by its ID

func (*Team) CanCreate

func (t *Team) CanCreate(_ *xorm.Session, a web.Auth) (bool, error)

CanCreate checks if the user can create a new team

func (*Team) CanDelete

func (t *Team) CanDelete(s *xorm.Session, a web.Auth) (bool, error)

CanDelete checks if a user can delete a team

func (*Team) CanRead

func (t *Team) CanRead(s *xorm.Session, a web.Auth) (bool, int, error)

CanRead returns true if the user has read access to the team

func (*Team) CanUpdate

func (t *Team) CanUpdate(s *xorm.Session, a web.Auth) (bool, error)

CanUpdate checks if the user can update a team

func (*Team) Create

func (t *Team) Create(s *xorm.Session, a web.Auth) (err error)

Create is the handler to create a team @Summary Creates a new team @Description Creates a new team. @tags team @Accept json @Produce json @Security JWTKeyAuth @Param team body models.Team true "The team you want to create." @Success 201 {object} models.Team "The created team." @Failure 400 {object} web.HTTPError "Invalid team object provided." @Failure 500 {object} models.Message "Internal error" @Router /teams [put]

func (*Team) Delete

func (t *Team) Delete(s *xorm.Session, a web.Auth) (err error)

Delete deletes a team @Summary Deletes a team @Description Delets a team. This will also remove the access for all users in that team. @tags team @Produce json @Security JWTKeyAuth @Param id path int true "Team ID" @Success 200 {object} models.Message "The team was successfully deleted." @Failure 400 {object} web.HTTPError "Invalid team object provided." @Failure 500 {object} models.Message "Internal error" @Router /teams/{id} [delete]

func (*Team) IsAdmin

func (t *Team) IsAdmin(s *xorm.Session, a web.Auth) (bool, error)

IsAdmin returns true when the user is admin of a team

func (*Team) ReadAll

func (t *Team) ReadAll(s *xorm.Session, a web.Auth, search string, page int, perPage int) (result interface{}, resultCount int, numberOfTotalItems int64, err error)

ReadAll gets all teams the user is part of @Summary Get teams @Description Returns all teams the current user is part of. @tags team @Accept json @Produce json @Param page query int false "The page number. Used for pagination. If not provided, the first page of results is returned." @Param per_page query int false "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page." @Param s query string false "Search teams by its name." @Security JWTKeyAuth @Success 200 {array} models.Team "The teams." @Failure 500 {object} models.Message "Internal error" @Router /teams [get]

func (*Team) ReadOne

func (t *Team) ReadOne(s *xorm.Session, _ web.Auth) (err error)

ReadOne implements the CRUD method to get one team @Summary Gets one team @Description Returns a team by its ID. @tags team @Accept json @Produce json @Security JWTKeyAuth @Param id path int true "Team ID" @Success 200 {object} models.Team "The team" @Failure 403 {object} web.HTTPError "The user does not have access to the team" @Failure 500 {object} models.Message "Internal error" @Router /teams/{id} [get]

func (Team) TableName

func (Team) TableName() string

TableName makes beautiful table names

func (*Team) Update

func (t *Team) Update(s *xorm.Session, _ web.Auth) (err error)

Update is the handler to create a team @Summary Updates a team @Description Updates a team. @tags team @Accept json @Produce json @Security JWTKeyAuth @Param id path int true "Team ID" @Param team body models.Team true "The team with updated values you want to update." @Success 200 {object} models.Team "The updated team." @Failure 400 {object} web.HTTPError "Invalid team object provided." @Failure 500 {object} models.Message "Internal error" @Router /teams/{id} [post]

type TeamCreatedEvent added in v0.17.0

type TeamCreatedEvent struct {
	Team *Team    `json:"team"`
	Doer web.Auth `json:"doer"`
}

TeamCreatedEvent represents a TeamCreatedEvent event

func (*TeamCreatedEvent) Name added in v0.17.0

func (t *TeamCreatedEvent) Name() string

Name defines the name for TeamCreatedEvent

type TeamDeletedEvent added in v0.17.0

type TeamDeletedEvent struct {
	Team *Team    `json:"team"`
	Doer web.Auth `json:"doer"`
}

TeamDeletedEvent represents a TeamDeletedEvent event

func (*TeamDeletedEvent) Name added in v0.17.0

func (t *TeamDeletedEvent) Name() string

Name defines the name for TeamDeletedEvent

type TeamMember

type TeamMember struct {
	// The unique, numeric id of this team member relation.
	ID int64 `xorm:"bigint autoincr not null unique pk" json:"id"`
	// The team id.
	TeamID int64 `xorm:"bigint not null INDEX" json:"-" param:"team"`
	// The username of the member. We use this to prevent automated user id entering.
	Username string `xorm:"-" json:"username" param:"user"`
	// Used under the hood to manage team members
	UserID int64 `xorm:"bigint not null INDEX" json:"-"`
	// Whether or not the member is an admin of the team. See the docs for more about what a team admin can do
	Admin bool `xorm:"null" json:"admin"`

	// A timestamp when this relation was created. You cannot change this value.
	Created time.Time `xorm:"created not null" json:"created"`

	web.CRUDable `xorm:"-" json:"-"`
	web.Rights   `xorm:"-" json:"-"`
}

TeamMember defines the relationship between a user and a team

func (*TeamMember) CanCreate

func (tm *TeamMember) CanCreate(s *xorm.Session, a web.Auth) (bool, error)

CanCreate checks if the user can add a new tem member

func (*TeamMember) CanDelete

func (tm *TeamMember) CanDelete(s *xorm.Session, a web.Auth) (bool, error)

CanDelete checks if the user can delete a new team member

func (*TeamMember) CanUpdate added in v0.15.0

func (tm *TeamMember) CanUpdate(s *xorm.Session, a web.Auth) (bool, error)

CanUpdate checks if the user can modify a team member's right

func (*TeamMember) Create

func (tm *TeamMember) Create(s *xorm.Session, a web.Auth) (err error)

Create implements the create method to assign a user to a team @Summary Add a user to a team @Description Add a user to a team. @tags team @Accept json @Produce json @Security JWTKeyAuth @Param id path int true "Team ID" @Param team body models.TeamMember true "The user to be added to a team." @Success 201 {object} models.TeamMember "The newly created member object" @Failure 400 {object} web.HTTPError "Invalid member object provided." @Failure 403 {object} web.HTTPError "The user does not have access to the team" @Failure 500 {object} models.Message "Internal error" @Router /teams/{id}/members [put]

func (*TeamMember) Delete

func (tm *TeamMember) Delete(s *xorm.Session, _ web.Auth) (err error)

Delete deletes a user from a team @Summary Remove a user from a team @Description Remove a user from a team. This will also revoke any access this user might have via that team. A user can remove themselves from the team if they are not the last user in the team. @tags team @Produce json @Security JWTKeyAuth @Param id path int true "Team ID" @Param userID path int true "User ID" @Success 200 {object} models.Message "The user was successfully removed from the team." @Failure 500 {object} models.Message "Internal error" @Router /teams/{id}/members/{userID} [delete]

func (*TeamMember) IsAdmin

func (tm *TeamMember) IsAdmin(s *xorm.Session, a web.Auth) (bool, error)

IsAdmin checks if the user is team admin

func (*TeamMember) TableName

func (*TeamMember) TableName() string

TableName makes beautiful table names

func (*TeamMember) Update added in v0.15.0

func (tm *TeamMember) Update(s *xorm.Session, _ web.Auth) (err error)

Update toggles a team member's admin status @Summary Toggle a team member's admin status @Description If a user is team admin, this will make them member and vise-versa. @tags team @Produce json @Security JWTKeyAuth @Param id path int true "Team ID" @Param userID path int true "User ID" @Success 200 {object} models.Message "The member right was successfully changed." @Failure 500 {object} models.Message "Internal error" @Router /teams/{id}/members/{userID}/admin [post]

type TeamMemberAddedEvent added in v0.17.0

type TeamMemberAddedEvent struct {
	Team   *Team      `json:"team"`
	Member *user.User `json:"member"`
	Doer   *user.User `json:"doer"`
}

TeamMemberAddedEvent defines an event where a user is added to a team

func (*TeamMemberAddedEvent) Name added in v0.17.0

func (t *TeamMemberAddedEvent) Name() string

Name defines the name for TeamMemberAddedEvent

type TeamMemberAddedNotification added in v0.17.0

type TeamMemberAddedNotification struct {
	Member *user.User `json:"member"`
	Doer   *user.User `json:"doer"`
	Team   *Team      `json:"team"`
}

TeamMemberAddedNotification represents a TeamMemberAddedNotification notification

func (*TeamMemberAddedNotification) Name added in v0.17.0

Name returns the name of the notification

func (*TeamMemberAddedNotification) ToDB added in v0.17.0

func (n *TeamMemberAddedNotification) ToDB() interface{}

ToDB returns the TeamMemberAddedNotification notification in a format which can be saved in the db

func (*TeamMemberAddedNotification) ToMail added in v0.17.0

ToMail returns the mail notification for TeamMemberAddedNotification

type TeamProject added in v0.21.0

type TeamProject struct {
	// The unique, numeric id of this project <-> team relation.
	ID int64 `xorm:"bigint autoincr not null unique pk" json:"id"`
	// The team id.
	TeamID int64 `xorm:"bigint not null INDEX" json:"team_id" param:"team"`
	// The project id.
	ProjectID int64 `xorm:"bigint not null INDEX" json:"-" param:"project"`
	// The right this team has. 0 = Read only, 1 = Read & Write, 2 = Admin. See the docs for more details.
	Right Right `xorm:"bigint INDEX not null default 0" json:"right" valid:"length(0|2)" maximum:"2" default:"0"`

	// A timestamp when this relation was created. You cannot change this value.
	Created time.Time `xorm:"created not null" json:"created"`
	// A timestamp when this relation was last updated. You cannot change this value.
	Updated time.Time `xorm:"updated not null" json:"updated"`

	web.CRUDable `xorm:"-" json:"-"`
	web.Rights   `xorm:"-" json:"-"`
}

TeamProject defines the relation between a team and a project

func (*TeamProject) CanCreate added in v0.21.0

func (tl *TeamProject) CanCreate(s *xorm.Session, a web.Auth) (bool, error)

CanCreate checks if the user can create a team <-> project relation

func (*TeamProject) CanDelete added in v0.21.0

func (tl *TeamProject) CanDelete(s *xorm.Session, a web.Auth) (bool, error)

CanDelete checks if the user can delete a team <-> project relation

func (*TeamProject) CanUpdate added in v0.21.0

func (tl *TeamProject) CanUpdate(s *xorm.Session, a web.Auth) (bool, error)

CanUpdate checks if the user can update a team <-> project relation

func (*TeamProject) Create added in v0.21.0

func (tl *TeamProject) Create(s *xorm.Session, a web.Auth) (err error)

Create creates a new team <-> project relation @Summary Add a team to a project @Description Gives a team access to a project. @tags sharing @Accept json @Produce json @Security JWTKeyAuth @Param id path int true "Project ID" @Param project body models.TeamProject true "The team you want to add to the project." @Success 201 {object} models.TeamProject "The created team<->project relation." @Failure 400 {object} web.HTTPError "Invalid team project object provided." @Failure 404 {object} web.HTTPError "The team does not exist." @Failure 403 {object} web.HTTPError "The user does not have access to the project" @Failure 500 {object} models.Message "Internal error" @Router /projects/{id}/teams [put]

func (*TeamProject) Delete added in v0.21.0

func (tl *TeamProject) Delete(s *xorm.Session, _ web.Auth) (err error)

Delete deletes a team <-> project relation based on the project & team id @Summary Delete a team from a project @Description Delets a team from a project. The team won't have access to the project anymore. @tags sharing @Produce json @Security JWTKeyAuth @Param projectID path int true "Project ID" @Param teamID path int true "Team ID" @Success 200 {object} models.Message "The team was successfully deleted." @Failure 403 {object} web.HTTPError "The user does not have access to the project" @Failure 404 {object} web.HTTPError "Team or project does not exist." @Failure 500 {object} models.Message "Internal error" @Router /projects/{projectID}/teams/{teamID} [delete]

func (*TeamProject) ReadAll added in v0.21.0

func (tl *TeamProject) ReadAll(s *xorm.Session, a web.Auth, search string, page int, perPage int) (result interface{}, resultCount int, totalItems int64, err error)

ReadAll implements the method to read all teams of a project @Summary Get teams on a project @Description Returns a project with all teams which have access on a given project. @tags sharing @Accept json @Produce json @Param id path int true "Project ID" @Param page query int false "The page number. Used for pagination. If not provided, the first page of results is returned." @Param per_page query int false "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page." @Param s query string false "Search teams by its name." @Security JWTKeyAuth @Success 200 {array} models.TeamWithRight "The teams with their right." @Failure 403 {object} web.HTTPError "No right to see the project." @Failure 500 {object} models.Message "Internal error" @Router /projects/{id}/teams [get]

func (TeamProject) TableName added in v0.21.0

func (TeamProject) TableName() string

TableName makes beautiful table names

func (*TeamProject) Update added in v0.21.0

func (tl *TeamProject) Update(s *xorm.Session, _ web.Auth) (err error)

Update updates a team <-> project relation @Summary Update a team <-> project relation @Description Update a team <-> project relation. Mostly used to update the right that team has. @tags sharing @Accept json @Produce json @Param projectID path int true "Project ID" @Param teamID path int true "Team ID" @Param project body models.TeamProject true "The team you want to update." @Security JWTKeyAuth @Success 200 {object} models.TeamProject "The updated team <-> project relation." @Failure 403 {object} web.HTTPError "The user does not have admin-access to the project" @Failure 404 {object} web.HTTPError "Team or project does not exist." @Failure 500 {object} models.Message "Internal error" @Router /projects/{projectID}/teams/{teamID} [post]

type TeamUser

type TeamUser struct {
	user.User `xorm:"extends"`
	// Whether or not the member is an admin of the team. See the docs for more about what a team admin can do
	Admin  bool  `json:"admin"`
	TeamID int64 `json:"-"`
}

TeamUser is the team member type

type TeamWithRight

type TeamWithRight struct {
	Team  `xorm:"extends"`
	Right Right `json:"right"`
}

TeamWithRight represents a team, combined with rights.

type TypesenseSync added in v0.22.0

type TypesenseSync struct {
	Collection     string    `xorm:"not null"`
	SyncStartedAt  time.Time `xorm:"not null"`
	SyncFinishedAt time.Time `xorm:"null"`
}

type UndoneTaskOverdueNotification added in v0.17.0

type UndoneTaskOverdueNotification struct {
	User    *user.User
	Task    *Task
	Project *Project
}

UndoneTaskOverdueNotification represents a UndoneTaskOverdueNotification notification

func (*UndoneTaskOverdueNotification) Name added in v0.17.0

Name returns the name of the notification

func (*UndoneTaskOverdueNotification) ToDB added in v0.17.0

func (n *UndoneTaskOverdueNotification) ToDB() interface{}

ToDB returns the UndoneTaskOverdueNotification notification in a format which can be saved in the db

func (*UndoneTaskOverdueNotification) ToMail added in v0.17.0

ToMail returns the mail notification for UndoneTaskOverdueNotification

type UndoneTasksOverdueNotification added in v0.17.0

type UndoneTasksOverdueNotification struct {
	User     *user.User
	Tasks    map[int64]*Task
	Projects map[int64]*Project
}

UndoneTasksOverdueNotification represents a UndoneTasksOverdueNotification notification

func (*UndoneTasksOverdueNotification) Name added in v0.17.0

Name returns the name of the notification

func (*UndoneTasksOverdueNotification) ToDB added in v0.17.0

func (n *UndoneTasksOverdueNotification) ToDB() interface{}

ToDB returns the UndoneTasksOverdueNotification notification in a format which can be saved in the db

func (*UndoneTasksOverdueNotification) ToMail added in v0.17.0

ToMail returns the mail notification for UndoneTasksOverdueNotification

type UnsplashPhoto added in v0.14.0

type UnsplashPhoto struct {
	ID         int64  `xorm:"autoincr not null unique pk" json:"id,omitempty"`
	FileID     int64  `xorm:"not null" json:"-"`
	UnsplashID string `xorm:"varchar(50)" json:"unsplash_id"`
	Author     string `xorm:"text" json:"author"`
	AuthorName string `xorm:"text" json:"author_name"`
}

UnsplashPhoto is an unsplash photo in the db

func GetUnsplashPhotoByFileID added in v0.14.0

func GetUnsplashPhotoByFileID(s *xorm.Session, fileID int64) (u *UnsplashPhoto, err error)

GetUnsplashPhotoByFileID returns an unsplash photo by its saved file id

func (*UnsplashPhoto) Save added in v0.14.0

func (u *UnsplashPhoto) Save(s *xorm.Session) error

Save persists an unsplash photo to the db

func (*UnsplashPhoto) TableName added in v0.14.0

func (u *UnsplashPhoto) TableName() string

TableName contains the table name for an unsplash photo

type UpdateTaskInTypesense added in v0.22.1

type UpdateTaskInTypesense struct {
}

UpdateTaskInTypesense represents a listener

func (*UpdateTaskInTypesense) Handle added in v0.22.1

func (l *UpdateTaskInTypesense) Handle(msg *message.Message) (err error)

Handle is executed when the event UpdateTaskInTypesense listens on is fired

func (*UpdateTaskInTypesense) Name added in v0.22.1

func (l *UpdateTaskInTypesense) Name() string

Name defines the name for the UpdateTaskInTypesense listener

type UserDataExportRequestedEvent added in v0.18.0

type UserDataExportRequestedEvent struct {
	User *user.User `json:"user"`
}

UserDataExportRequestedEvent represents a UserDataExportRequestedEvent event

func (*UserDataExportRequestedEvent) Name added in v0.18.0

Name defines the name for UserDataExportRequestedEvent

type UserMentionedInTaskNotification added in v0.18.0

type UserMentionedInTaskNotification struct {
	Doer  *user.User `json:"doer"`
	Task  *Task      `json:"task"`
	IsNew bool       `json:"is_new"`
}

UserMentionedInTaskNotification represents a UserMentionedInTaskNotification notification

func (*UserMentionedInTaskNotification) Name added in v0.18.0

Name returns the name of the notification

func (*UserMentionedInTaskNotification) SubjectID added in v0.18.0

func (n *UserMentionedInTaskNotification) SubjectID() int64

func (*UserMentionedInTaskNotification) ToDB added in v0.18.0

func (n *UserMentionedInTaskNotification) ToDB() interface{}

ToDB returns the UserMentionedInTaskNotification notification in a format which can be saved in the db

func (*UserMentionedInTaskNotification) ToMail added in v0.18.0

ToMail returns the mail notification for UserMentionedInTaskNotification

type UserWithRight

type UserWithRight struct {
	user.User `xorm:"extends"`
	Right     Right `json:"right"`
}

UserWithRight represents a user in combination with the right it can have on a project

type ValidationHTTPError

type ValidationHTTPError struct {
	web.HTTPError
	InvalidFields []string `json:"invalid_fields"`
}

ValidationHTTPError is the http error when a validation fails

func (ValidationHTTPError) Error

func (err ValidationHTTPError) Error() string

Error implements the Error type (so we can return it as type error)

type Webhook added in v0.22.0

type Webhook struct {
	// The generated ID of this webhook target
	ID int64 `xorm:"bigint autoincr not null unique pk" json:"id" param:"webhook"`
	// The target URL where the POST request with the webhook payload will be made
	TargetURL string `xorm:"not null" valid:"required,url" json:"target_url"`
	// The webhook events which should fire this webhook target
	Events []string `xorm:"JSON not null" valid:"required" json:"events"`
	// The project ID of the project this webhook target belongs to
	ProjectID int64 `xorm:"bigint not null index" json:"project_id" param:"project"`
	// If provided, webhook requests will be signed using HMAC. Check out the docs about how to use this: https://vikunja.io/docs/webhooks/#signing
	Secret string `xorm:"null" json:"secret"`

	// The user who initially created the webhook target.
	CreatedBy   *user.User `xorm:"-" json:"created_by" valid:"-"`
	CreatedByID int64      `xorm:"bigint not null" json:"-"`

	// A timestamp when this webhook target was created. You cannot change this value.
	Created time.Time `xorm:"created not null" json:"created"`
	// A timestamp when this webhook target was last updated. You cannot change this value.
	Updated time.Time `xorm:"updated not null" json:"updated"`

	web.CRUDable `xorm:"-" json:"-"`
	web.Rights   `xorm:"-" json:"-"`
}

func (*Webhook) CanCreate added in v0.22.0

func (w *Webhook) CanCreate(s *xorm.Session, a web.Auth) (bool, error)

func (*Webhook) CanDelete added in v0.22.0

func (w *Webhook) CanDelete(s *xorm.Session, a web.Auth) (bool, error)

func (*Webhook) CanRead added in v0.22.0

func (w *Webhook) CanRead(s *xorm.Session, a web.Auth) (bool, int, error)

func (*Webhook) CanUpdate added in v0.22.0

func (w *Webhook) CanUpdate(s *xorm.Session, a web.Auth) (bool, error)

func (*Webhook) Create added in v0.22.0

func (w *Webhook) Create(s *xorm.Session, a web.Auth) (err error)

Create creates a webhook target @Summary Create a webhook target @Description Create a webhook target which receives POST requests about specified events from a project. @tags webhooks @Accept json @Produce json @Security JWTKeyAuth @Param id path int true "Project ID" @Param webhook body models.Webhook true "The webhook target object with required fields" @Success 200 {object} models.Webhook "The created webhook target." @Failure 400 {object} web.HTTPError "Invalid webhook object provided." @Failure 500 {object} models.Message "Internal error" @Router /projects/{id}/webhooks [put]

func (*Webhook) Delete added in v0.22.0

func (w *Webhook) Delete(s *xorm.Session, _ web.Auth) (err error)

Delete deletes a webhook target @Summary Deletes an existing webhook target @Description Delete any of the project's webhook targets. @tags webhooks @Accept json @Produce json @Security JWTKeyAuth @Param id path int true "Project ID" @Param webhookID path int true "Webhook ID" @Success 200 {object} models.Message "Successfully deleted." @Failure 404 {object} web.HTTPError "The webhok target does not exist." @Failure 500 {object} models.Message "Internal error" @Router /projects/{id}/webhooks/{webhookID} [delete]

func (*Webhook) ReadAll added in v0.22.0

func (w *Webhook) ReadAll(s *xorm.Session, a web.Auth, _ string, page int, perPage int) (result interface{}, resultCount int, numberOfTotalItems int64, err error)

ReadAll returns all webhook targets for a project @Summary Get all api webhook targets for the specified project @Description Get all api webhook targets for the specified project. @tags webhooks @Accept json @Produce json @Security JWTKeyAuth @Param page query int false "The page number. Used for pagination. If not provided, the first page of results is returned." @Param per_page query int false "The maximum number of items per bucket per page. This parameter is limited by the configured maximum of items per page." @Param id path int true "Project ID" @Success 200 {array} models.Webhook "The list of all webhook targets" @Failure 500 {object} models.Message "Internal server error" @Router /projects/{id}/webhooks [get]

func (*Webhook) TableName added in v0.22.0

func (w *Webhook) TableName() string

func (*Webhook) Update added in v0.22.0

func (w *Webhook) Update(s *xorm.Session, _ web.Auth) (err error)

Update updates a webhook target @Summary Change a webhook target's events. @Description Change a webhook target's events. You cannot change other values of a webhook. @tags webhooks @Accept json @Produce json @Security JWTKeyAuth @Param id path int true "Project ID" @Param webhookID path int true "Webhook ID" @Success 200 {object} models.Webhook "Updated webhook target" @Failure 404 {object} web.HTTPError "The webhok target does not exist" @Failure 500 {object} models.Message "Internal error" @Router /projects/{id}/webhooks/{webhookID} [post]

type WebhookListener added in v0.22.0

type WebhookListener struct {
	EventName string
}

WebhookListener represents a listener

func (*WebhookListener) Handle added in v0.22.0

func (wl *WebhookListener) Handle(msg *message.Message) (err error)

Handle is executed when the event WebhookListener listens on is fired

func (*WebhookListener) Name added in v0.22.0

func (wl *WebhookListener) Name() string

Name defines the name for the WebhookListener listener

type WebhookPayload added in v0.22.0

type WebhookPayload struct {
	EventName string      `json:"event_name"`
	Time      time.Time   `json:"time"`
	Data      interface{} `json:"data"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL