models

package
v0.24.4 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2024 License: AGPL-3.0 Imports: 60 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReactionKindTask = iota
	ReactionKindComment
)
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 ErrCodeInvalidFilterExpression = 4024

ErrCodeInvalidFilterExpression holds the unique world-error code of this error

View Source
const ErrCodeInvalidReactionEntityKind = 4025

ErrCodeInvalidReactionEntityKind 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 ErrCodeMustHaveProjectViewToSortByPosition = 4026

ErrCodeMustHaveProjectViewToSortByPosition holds the unique world-error code of this error

View Source
const ErrCodeMustProvideUser = 12003

ErrCodeMustProvideUser 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 ErrCodeOIDCTeamDoesNotExist = 6008

ErrCodeTeamDoesNotExist holds the unique world-error code of this error

View Source
const ErrCodeOIDCTeamsDoNotExistForUser = 6009

ErrCodeTeamDoesNotExist 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 ErrCodeProjectViewDoesNotExist = 3014

ErrCodeProjectViewDoesNotExist 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 = 4023

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 FavoritesPseudoProjectID = -1
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:          FavoritesPseudoProjectID,
	Title:       "Favorites",
	Description: "This project has all tasks marked as favorites.",
	IsFavorite:  true,
	Position:    -1,

	Views: []*ProjectView{
		{
			ID:        -1,
			ProjectID: FavoritesPseudoProjectID,
			Title:     "List",
			ViewKind:  ProjectViewKindList,
			Position:  100,
			Filter:    "done = false",
		},
		{
			ID:        -2,
			ProjectID: FavoritesPseudoProjectID,
			Title:     "Gantt",
			ViewKind:  ProjectViewKindGantt,
			Position:  200,
		},
		{
			ID:        -3,
			ProjectID: FavoritesPseudoProjectID,
			Title:     "Table",
			ViewKind:  ProjectViewKindTable,
			Position:  300,
		},
	},

	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, middlewares []echo.MiddlewareFunc)

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

func CreateDefaultViewsForProject added in v0.24.0

func CreateDefaultViewsForProject(s *xorm.Session, project *Project, a web.Auth, createBacklogBucket bool, createDefaultListFilter bool) (err error)

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, createDefaultViews 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 FindAllOidcTeamIDsForUser added in v0.24.0

func FindAllOidcTeamIDsForUser(s *xorm.Session, userID int64) (ts []int64, err error)

func FindMentionedUsersInText added in v0.18.0

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

func GetAllParentProjects added in v0.24.0

func GetAllParentProjects(s *xorm.Session, projectID int64) (allProjects map[int64]*Project, err error)

GetAllParentProjects returns all parents of a given project

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 GetProjectsMapByIDs added in v0.24.0

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

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

func GetProjectsMapSimplByTaskIDs added in v0.24.0

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

GetProjectsMapSimplByTaskIDs gets a list of projects by a task ids

func GetSubscriptionsForEntities added in v0.24.3

func GetSubscriptionsForEntities(s *xorm.Session, entityType SubscriptionEntityType, entityIDs []int64) (subscriptions map[int64][]*SubscriptionWithUser, err error)

GetSubscriptionsForEntities returns a list of subscriptions to for an entity ID

func GetSubscriptionsForEntitiesAndUser added in v0.24.3

func GetSubscriptionsForEntitiesAndUser(s *xorm.Session, entityType SubscriptionEntityType, entityIDs []int64, u *user.User) (subscriptions map[int64][]*SubscriptionWithUser, err error)

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 ErrBucketDoesNotBelongToProjectView.

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 IsErrInvalidFilterExpression added in v0.24.0

func IsErrInvalidFilterExpression(err error) bool

IsErrInvalidFilterExpression checks if an error is ErrInvalidFilterExpression.

func IsErrInvalidReactionEntityKind added in v0.24.0

func IsErrInvalidReactionEntityKind(err error) bool

IsErrInvalidReactionEntityKind checks if an error is ErrInvalidReactionEntityKind.

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 IsErrMustProvideUser added in v0.24.3

func IsErrMustProvideUser(err error) bool

IsErrMustProvideUser checks if an error is ErrMustProvideUser.

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 IsErrOIDCTeamDoesNotExist added in v0.24.0

func IsErrOIDCTeamDoesNotExist(err error) bool

IsErrOIDCTeamDoesNotExist checks if an error is ErrOIDCTeamDoesNotExist.

func IsErrOIDCTeamsDoNotExistForUser added in v0.24.0

func IsErrOIDCTeamsDoNotExistForUser(err error) bool

IsErrOIDCTeamsDoNotExistForUser checks if an error is ErrOIDCTeamsDoNotExistForUser.

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 IsErrProjectViewDoesNotExist added in v0.24.0

func IsErrProjectViewDoesNotExist(err error) bool

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

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 RecalculateTaskPositions added in v0.24.0

func RecalculateTaskPositions(s *xorm.Session, view *ProjectView, a web.Auth) (err error)

func RegisterAddTaskToFilterViewCron added in v0.24.3

func RegisterAddTaskToFilterViewCron()

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 map[string]*RouteDetail

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:"-" json:"-" param:"project"`
	// The project view this bucket belongs to.
	ProjectViewID int64 `xorm:"bigint not null" json:"project_view_id" param:"view"`
	// 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 GetTasksInBucketsForView added in v0.24.0

func GetTasksInBucketsForView(s *xorm.Session, view *ProjectView, projects []*Project, opts *taskSearchOptions, auth web.Auth) (bucketsWithTasks []*Bucket, err error)

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 view path int true "Project view 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}/views/{view}/buckets [put]

func (*Bucket) Delete

func (b *Bucket) Delete(s *xorm.Session, a 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" @Param view path int true "Project view 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}/views/{view}/buckets/{bucketID} [delete]

func (*Bucket) ReadAll

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

ReadAll returns all manual buckets for a certain project @Summary Get all kanban buckets of a project @Description Returns all kanban buckets which belong to that project. Buckets are always sorted by their `position` in ascending order. To get all buckets with their tasks, use the tasks endpoint with a kanban view. @tags project @Accept json @Produce json @Security JWTKeyAuth @Param id path int true "Project ID" @Param view path int true "Project view ID" @Success 200 {array} models.Bucket "The buckets" @Failure 500 {object} models.Message "Internal server error" @Router /projects/{id}/views/{view}/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 view path int true "Project view 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}/views/{view}/buckets/{bucketID} [post]

type BucketConfigurationModeKind added in v0.24.0

type BucketConfigurationModeKind int
const (
	BucketConfigurationModeNone BucketConfigurationModeKind = iota
	BucketConfigurationModeManual
	BucketConfigurationModeFilter
)

func (*BucketConfigurationModeKind) MarshalJSON added in v0.24.0

func (p *BucketConfigurationModeKind) MarshalJSON() ([]byte, error)

func (*BucketConfigurationModeKind) UnmarshalJSON added in v0.24.0

func (p *BucketConfigurationModeKind) UnmarshalJSON(bytes []byte) error

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 ErrBucketDoesNotBelongToProjectView added in v0.24.0

type ErrBucketDoesNotBelongToProjectView struct {
	BucketID      int64
	ProjectViewID int64
}

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

func (ErrBucketDoesNotBelongToProjectView) Error added in v0.24.0

func (ErrBucketDoesNotBelongToProjectView) HTTPError added in v0.24.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
	ProjectViewID 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 ErrInvalidFilterExpression added in v0.24.0

type ErrInvalidFilterExpression struct {
	Expression      string
	ExpressionError error
}

ErrInvalidFilterExpression represents an error where the task filter expression was invalid

func (ErrInvalidFilterExpression) Error added in v0.24.0

func (err ErrInvalidFilterExpression) Error() string

func (ErrInvalidFilterExpression) HTTPError added in v0.24.0

func (err ErrInvalidFilterExpression) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrInvalidReactionEntityKind added in v0.24.0

type ErrInvalidReactionEntityKind struct {
	Kind string
}

ErrInvalidReactionEntityKind represents an error where the reaction kind is invalid

func (ErrInvalidReactionEntityKind) Error added in v0.24.0

func (ErrInvalidReactionEntityKind) HTTPError added in v0.24.0

func (err ErrInvalidReactionEntityKind) 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 ErrMustHaveProjectViewToSortByPosition added in v0.24.0

type ErrMustHaveProjectViewToSortByPosition struct{}

ErrMustHaveProjectViewToSortByPosition represents an error where no project view id was supplied

func (ErrMustHaveProjectViewToSortByPosition) Error added in v0.24.0

func (ErrMustHaveProjectViewToSortByPosition) HTTPError added in v0.24.0

HTTPError holds the http error description

type ErrMustProvideUser added in v0.24.3

type ErrMustProvideUser struct {
}

ErrMustProvideUser represents an error where you need to provide a user to fetch subscriptions

func (*ErrMustProvideUser) Error added in v0.24.3

func (err *ErrMustProvideUser) Error() string

func (ErrMustProvideUser) HTTPError added in v0.24.3

func (err ErrMustProvideUser) 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 ErrOIDCTeamDoesNotExist added in v0.24.0

type ErrOIDCTeamDoesNotExist struct {
	OidcID string
	Issuer string
}

ErrOIDCTeamDoesNotExist represents an error where a team with specified oidcId property does not exist for a given issuer

func (ErrOIDCTeamDoesNotExist) Error added in v0.24.0

func (err ErrOIDCTeamDoesNotExist) Error() string

ErrTeamDoesNotExist represents an error where a team does not exist

func (ErrOIDCTeamDoesNotExist) HTTPError added in v0.24.0

func (err ErrOIDCTeamDoesNotExist) HTTPError() web.HTTPError

HTTPError holds the http error description

type ErrOIDCTeamsDoNotExistForUser added in v0.24.0

type ErrOIDCTeamsDoNotExistForUser struct {
	UserID int64
}

ErrOIDCTeamsDoNotExistForUser represents an error where an oidcTeam does not exist for the user

func (ErrOIDCTeamsDoNotExistForUser) Error added in v0.24.0

func (ErrOIDCTeamsDoNotExistForUser) HTTPError added in v0.24.0

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 ErrProjectViewDoesNotExist added in v0.24.0

type ErrProjectViewDoesNotExist struct {
	ProjectViewID int64
}

ErrProjectViewDoesNotExist represents an error where the default project is being deleted

func (*ErrProjectViewDoesNotExist) Error added in v0.24.0

func (err *ErrProjectViewDoesNotExist) Error() string

func (*ErrProjectViewDoesNotExist) HTTPError added in v0.24.0

func (err *ErrProjectViewDoesNotExist) 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
}

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                web.Auth
	Search              []string
	Page                int
	PerPage             int
	TaskIDs             []int64
	GetUnusedLabels     bool
	GroupByLabelIDsOnly bool
	GetForUser          bool
}

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, auth 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, auth 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 OIDCTeam added in v0.24.0

type OIDCTeam struct {
	Name        string
	OidcID      string
	Description string
	IsPublic    bool
}

OIDCTeam is the relevant data for a team and is delivered by oidc token

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 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"`

	Views []*ProjectView `xorm:"-" json:"views"`

	// 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 GetProjectsByIDs added in v0.21.0

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

func GetProjectsSimplByTaskIDs added in v0.22.0

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

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) 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 ProjectView added in v0.24.0

type ProjectView struct {
	// The unique numeric id of this view
	ID int64 `xorm:"autoincr not null unique pk" json:"id" param:"view"`
	// The title of this view
	Title string `xorm:"varchar(255) not null" json:"title" valid:"required,runelength(1|250)"`
	// The project this view belongs to
	ProjectID int64 `xorm:"not null index" json:"project_id" param:"project"`
	// The kind of this view. Can be `list`, `gantt`, `table` or `kanban`.
	ViewKind ProjectViewKind `xorm:"not null" json:"view_kind"`

	// The filter query to match tasks by. Check out https://vikunja.io/docs/filters for a full explanation.
	Filter string `xorm:"text null default null" query:"filter" json:"filter"`
	// The position of this view in the list. The list of all views will be sorted by this parameter.
	Position float64 `xorm:"double null" json:"position"`

	// The bucket configuration mode. Can be `none`, `manual` or `filter`. `manual` allows to move tasks between buckets as you normally would. `filter` creates buckets based on a filter for each bucket.
	BucketConfigurationMode BucketConfigurationModeKind `xorm:"default 0" json:"bucket_configuration_mode"`
	// When the bucket configuration mode is not `manual`, this field holds the options of that configuration.
	BucketConfiguration []*ProjectViewBucketConfiguration `xorm:"json" json:"bucket_configuration"`
	// The ID of the bucket where new tasks without a bucket are added to. By default, this is the leftmost bucket in a view.
	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"`

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

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

func GetProjectViewByID added in v0.24.0

func GetProjectViewByID(s *xorm.Session, id int64) (view *ProjectView, err error)

func GetProjectViewByIDAndProject added in v0.24.0

func GetProjectViewByIDAndProject(s *xorm.Session, viewID, projectID int64) (view *ProjectView, err error)

func (*ProjectView) CanCreate added in v0.24.0

func (pv *ProjectView) CanCreate(s *xorm.Session, a web.Auth) (bool, error)

func (*ProjectView) CanDelete added in v0.24.0

func (pv *ProjectView) CanDelete(s *xorm.Session, a web.Auth) (bool, error)

func (*ProjectView) CanRead added in v0.24.0

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

func (*ProjectView) CanUpdate added in v0.24.0

func (pv *ProjectView) CanUpdate(s *xorm.Session, a web.Auth) (bool, error)

func (*ProjectView) Create added in v0.24.0

func (pv *ProjectView) Create(s *xorm.Session, a web.Auth) (err error)

Create adds a new project view @Summary Create a project view @Description Create a project view in a specific project. @tags project @Accept json @Produce json @Security JWTKeyAuth @Param project path int true "Project ID" @Param view body models.ProjectView true "The project view you want to create." @Success 200 {object} models.ProjectView "The created project view" @Failure 403 {object} web.HTTPError "The user does not have access to create a project view" @Failure 500 {object} models.Message "Internal error" @Router /projects/{project}/views [put]

func (*ProjectView) Delete added in v0.24.0

func (pv *ProjectView) Delete(s *xorm.Session, _ web.Auth) (err error)

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

func (*ProjectView) ReadAll added in v0.24.0

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

ReadAll gets all project views @Summary Get all project views for a project @Description Returns all project views for a sepcific project @tags project @Accept json @Produce json @Security JWTKeyAuth @Param project path int true "Project ID" @Success 200 {array} models.ProjectView "The project views" @Failure 500 {object} models.Message "Internal error" @Router /projects/{project}/views [get]

func (*ProjectView) ReadOne added in v0.24.0

func (pv *ProjectView) ReadOne(s *xorm.Session, _ web.Auth) (err error)

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

func (*ProjectView) TableName added in v0.24.0

func (pv *ProjectView) TableName() string

func (*ProjectView) Update added in v0.24.0

func (pv *ProjectView) Update(s *xorm.Session, _ web.Auth) (err error)

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

type ProjectViewBucketConfiguration added in v0.24.0

type ProjectViewBucketConfiguration struct {
	Title  string `json:"title"`
	Filter string `json:"filter"`
}

type ProjectViewKind added in v0.24.0

type ProjectViewKind int
const (
	ProjectViewKindList ProjectViewKind = iota
	ProjectViewKindGantt
	ProjectViewKindTable
	ProjectViewKindKanban
)

func (*ProjectViewKind) MarshalJSON added in v0.24.0

func (p *ProjectViewKind) MarshalJSON() ([]byte, error)

func (*ProjectViewKind) UnmarshalJSON added in v0.24.0

func (p *ProjectViewKind) UnmarshalJSON(bytes []byte) error

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"`
	TaskBuckets      []*TaskBucket   `xorm:"-" json:"task_buckets"`
	Positions        []*TaskPosition `xorm:"-" json:"positions"`
	BackgroundFileID int64           `xorm:"null" json:"background_file_id"`
}

type Reaction added in v0.24.0

type Reaction struct {
	// The unique numeric id of this reaction
	ID int64 `xorm:"autoincr not null unique pk" json:"-" param:"reaction"`

	// The user who reacted
	User   *user.User `xorm:"-" json:"user" valid:"-"`
	UserID int64      `xorm:"bigint not null INDEX" json:"-"`

	// The id of the entity you're reacting to
	EntityID int64 `xorm:"bigint not null INDEX" json:"-" param:"entityid"`
	// The entity kind which you're reacting to. Can be 0 for task, 1 for comment.
	EntityKind       ReactionKind `xorm:"bigint not null INDEX" json:"-"`
	EntityKindString string       `xorm:"-" json:"-" param:"entitykind"`

	// The actual reaction. This can be any valid utf character or text, up to a length of 20.
	Value string `xorm:"varchar(20) not null INDEX" json:"value" valid:"required"`

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

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

func (*Reaction) CanCreate added in v0.24.0

func (r *Reaction) CanCreate(s *xorm.Session, a web.Auth) (bool, error)

func (*Reaction) CanDelete added in v0.24.0

func (r *Reaction) CanDelete(s *xorm.Session, a web.Auth) (bool, error)

func (*Reaction) CanRead added in v0.24.0

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

func (*Reaction) Create added in v0.24.0

func (r *Reaction) Create(s *xorm.Session, a web.Auth) (err error)

Create adds a new reaction to an entity @Summary Add a reaction to an entity @Description Add a reaction to an entity. Will do nothing if the reaction already exists. @tags task @Accept json @Produce json @Security JWTKeyAuth @Param id path int true "Entity ID" @Param kind path int true "The kind of the entity. Can be either `tasks` or `comments` for task comments" @Param project body models.Reaction true "The reaction you want to add to the entity." @Success 200 {object} models.Reaction "The created reaction" @Failure 403 {object} web.HTTPError "The user does not have access to the entity" @Failure 500 {object} models.Message "Internal error" @Router /{kind}/{id}/reactions [put]

func (*Reaction) Delete added in v0.24.0

func (r *Reaction) Delete(s *xorm.Session, a web.Auth) (err error)

Delete removes the user's own reaction @Summary Removes the user's reaction @Description Removes the reaction of that user on that entity. @tags task @Accept json @Produce json @Security JWTKeyAuth @Param id path int true "Entity ID" @Param kind path int true "The kind of the entity. Can be either `tasks` or `comments` for task comments" @Param project body models.Reaction true "The reaction you want to add to the entity." @Success 200 {object} models.Message "The reaction was successfully removed." @Failure 403 {object} web.HTTPError "The user does not have access to the entity" @Failure 500 {object} models.Message "Internal error" @Router /{kind}/{id}/reactions/delete [post]

func (*Reaction) ReadAll added in v0.24.0

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

ReadAll gets all reactions for an entity @Summary Get all reactions for an entity @Description Returns all reactions for an entity @tags task @Accept json @Produce json @Security JWTKeyAuth @Param id path int true "Entity ID" @Param kind path int true "The kind of the entity. Can be either `tasks` or `comments` for task comments" @Success 200 {array} models.ReactionMap "The reactions" @Failure 403 {object} web.HTTPError "The user does not have access to the entity" @Failure 500 {object} models.Message "Internal error" @Router /{kind}/{id}/reactions [get]

func (*Reaction) TableName added in v0.24.0

func (*Reaction) TableName() string

type ReactionKind added in v0.24.0

type ReactionKind int

type ReactionMap added in v0.24.0

type ReactionMap map[string][]*user.User

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) (err 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"`
	Entity     string                 `xorm:"-" json:"-" 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
	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 (*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 table 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) MarshalJSON added in v0.24.3

func (st SubscriptionEntityType) MarshalJSON() ([]byte, error)

func (*SubscriptionEntityType) UnmarshalJSON added in v0.24.3

func (st *SubscriptionEntityType) UnmarshalJSON(bytes []byte) error

type SubscriptionWithUser added in v0.24.3

type SubscriptionWithUser struct {
	Subscription `xorm:"extends"`
	User         *user.User `xorm:"extends" json:"user"`
}

func GetSubscriptionForUser added in v0.24.3

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

func GetSubscriptionsForEntity added in v0.24.3

func GetSubscriptionsForEntity(s *xorm.Session, entityType SubscriptionEntityType, entityID int64) (subscriptions []*SubscriptionWithUser, err error)

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. This property is read-only, you must use the separate endpoint to add labels to a 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. This property is read-onlym, you must use the separate endpoint to add attachments to a task.
	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"`

	// The bucket id. Will only be populated when the task is accessed via a view with buckets.
	// Can be used to move a task between buckets. In that case, the new bucket must be in the same view as the old one.
	BucketID int64 `xorm:"-" json:"bucket_id"`

	// The position of the task - any task project can be sorted as usual by this parameter.
	// When accessing tasks via views with buckets, this is primarily used to sort them based on a range.
	// Positions are always saved per view. They will automatically be set if you request the tasks through a view
	// endpoint, otherwise they will always be 0. To update them, take a look at the Task Position endpoint.
	Position float64 `xorm:"-" json:"position"`

	// Reactions on that task.
	Reactions ReactionMap `xorm:"-" json:"reactions"`

	// 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 GetTasksSimpleByIDs added in v0.24.0

func GetTasksSimpleByIDs(s *xorm.Session, ids []int64) (tasks []*Task, err error)

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 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 query string false "The filter query to match tasks by. Check out https://vikunja.io/docs/filters for a full explanation of the feature." @Param filter_timezone query string false "The time zone which should be used for date match (statements like "now" resolve to different actual times)" @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`." @Param expand query string false "If set to `subtasks`, Vikunja will fetch only tasks which do not have subtasks and then in a second step, will fetch all of these subtasks. This may result in more tasks than the pagination limit being returned, but all subtasks will be present in the response. You can only set this to `subtasks`." @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.