Documentation
¶
Index ¶
- Constants
- Variables
- func Register(app *pocketbase.PocketBase)
- type CreateProjectCommand
- type CreateTaskCommand
- type MutationResult
- func CreateProject(ctx context.Context, app core.App, actorID string, ...) (MutationResult, error)
- func CreateTask(ctx context.Context, app core.App, actorID string, command CreateTaskCommand) (MutationResult, error)
- func DeleteTask(ctx context.Context, app core.App, actorID, taskID string) (MutationResult, error)
- func UpdateProject(ctx context.Context, app core.App, actorID string, ...) (MutationResult, error)
- func UpdateTask(ctx context.Context, app core.App, actorID string, command UpdateTaskCommand) (MutationResult, error)
- func UpsertLabel(ctx context.Context, app core.App, actorID string, command UpsertLabelCommand) (MutationResult, error)
- func UpsertMember(ctx context.Context, app core.App, actorID string, command UpsertMemberCommand) (MutationResult, error)
- func UpsertState(ctx context.Context, app core.App, actorID string, command UpsertStateCommand) (MutationResult, error)
- type ProjectCapabilities
- type ProjectLabelSummary
- type ProjectParticipantSummary
- type ProjectSearchOptions
- type ProjectStateSummary
- type ProjectSummary
- type TaskAssigneeSummary
- type TaskDeleteTarget
- type TaskDocSummary
- type TaskLabelSummary
- type TaskSearchOptions
- type TaskSearchResult
- type TaskStateSummary
- type TaskSummary
- type TemplateLabel
- type TemplateState
- type TemplateSummary
- type UpdateProjectCommand
- type UpdateTaskCommand
- type UpsertLabelCommand
- type UpsertMemberCommand
- type UpsertStateCommand
Constants ¶
const MaxProjectSearchResults = 20
Variables ¶
Functions ¶
func Register ¶
func Register(app *pocketbase.PocketBase)
Register attaches the Board routes and record hooks to the application.
Types ¶
type CreateProjectCommand ¶
type CreateProjectCommand struct {
Name string
Description string
TemplateID string
States []TemplateState
Labels []TemplateLabel
Members []UpsertMemberCommand
}
type CreateTaskCommand ¶
type MutationResult ¶
type MutationResult struct {
OK bool `json:"ok"`
Action string `json:"action"`
ResourceType string `json:"resourceType"`
ID string `json:"id"`
Name string `json:"name"`
ProjectID string `json:"projectId"`
}
func CreateProject ¶
func CreateProject(ctx context.Context, app core.App, actorID string, command CreateProjectCommand) (MutationResult, error)
func CreateTask ¶
func CreateTask(ctx context.Context, app core.App, actorID string, command CreateTaskCommand) (MutationResult, error)
func DeleteTask ¶ added in v0.0.7
DeleteTask re-reads and re-authorizes the target immediately before the mutation so an approval cannot outlive a permission or target change.
func UpdateProject ¶
func UpdateProject(ctx context.Context, app core.App, actorID string, command UpdateProjectCommand) (MutationResult, error)
func UpdateTask ¶
func UpdateTask(ctx context.Context, app core.App, actorID string, command UpdateTaskCommand) (MutationResult, error)
func UpsertLabel ¶
func UpsertLabel(ctx context.Context, app core.App, actorID string, command UpsertLabelCommand) (MutationResult, error)
func UpsertMember ¶
func UpsertMember(ctx context.Context, app core.App, actorID string, command UpsertMemberCommand) (MutationResult, error)
func UpsertState ¶
func UpsertState(ctx context.Context, app core.App, actorID string, command UpsertStateCommand) (MutationResult, error)
type ProjectCapabilities ¶
type ProjectCapabilities struct {
CanEditProject bool `json:"canEditProject"`
CanManageWorkflow bool `json:"canManageWorkflow"`
CanManageMembers bool `json:"canManageMembers"`
CanEditTasks bool `json:"canEditTasks"`
CanDeleteTasks bool `json:"canDeleteTasks"`
CanDeleteProject bool `json:"canDeleteProject"`
}
type ProjectLabelSummary ¶
type ProjectSearchOptions ¶
type ProjectStateSummary ¶
type ProjectSummary ¶
type ProjectSummary struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Archived bool `json:"archived"`
Owner ProjectParticipantSummary `json:"owner"`
States []ProjectStateSummary `json:"states"`
Labels []ProjectLabelSummary `json:"labels,omitempty"`
Members []ProjectParticipantSummary `json:"members,omitempty"`
Participants []ProjectParticipantSummary `json:"participants,omitempty"`
CurrentActorRole string `json:"currentActorRole"`
Capabilities ProjectCapabilities `json:"capabilities"`
}
func GetVisibleProject ¶
func GetVisibleProject(ctx context.Context, app core.App, actorID, projectID string) (ProjectSummary, error)
GetVisibleProject returns a single project by ID if it is visible to the actor (owner or member). The result includes states with task counts.
func SearchVisibleProjects ¶
func SearchVisibleProjects(ctx context.Context, app core.App, actorID string, options ProjectSearchOptions) ([]ProjectSummary, error)
SearchVisibleProjects centralizes the same owner-or-member visibility rule used by the Board API. Agent tools call this domain query instead of duplicating collection authorization logic.
type TaskAssigneeSummary ¶
type TaskAssigneeSummary struct {
ID string `json:"id"`
Name string `json:"name"`
Avatar string `json:"avatar,omitempty"`
CollectionID string `json:"collectionId,omitempty"`
}
TaskAssigneeSummary is an assignee resolved to a display name and avatar.
type TaskDeleteTarget ¶ added in v0.0.7
type TaskDeleteTarget struct {
ID string `json:"id"`
Title string `json:"title"`
ProjectID string `json:"projectId"`
ProjectName string `json:"projectName"`
}
func GetDeletableTask ¶ added in v0.0.7
func GetDeletableTask(ctx context.Context, app core.App, actorID, taskID string) (TaskDeleteTarget, error)
GetDeletableTask resolves a task for a human-readable approval prompt and verifies that the actor can currently edit tasks in its project.
type TaskDocSummary ¶
TaskDocSummary is a linked document resolved to its id and title so a tool consumer can decide whether to open it (e.g. via docs_get).
type TaskLabelSummary ¶
type TaskLabelSummary struct {
ID string `json:"id"`
Name string `json:"name"`
Color string `json:"color"`
}
TaskLabelSummary is a label resolved to its display name and color.
type TaskSearchOptions ¶
type TaskSearchResult ¶
type TaskSearchResult struct {
States []TaskStateSummary `json:"states"`
Tasks []TaskSummary `json:"tasks"`
}
TaskSearchResult bundles the matching states and tasks so a tool consumer can render them grouped by state.
func SearchVisibleTasks ¶
func SearchVisibleTasks(ctx context.Context, app core.App, actorID string, options TaskSearchOptions) (TaskSearchResult, error)
SearchVisibleTasks returns the tasks of a project visible to the actor, optionally filtered by one or more states. Labels and assignee names are resolved server-side so the tool result is self-contained.
type TaskStateSummary ¶
type TaskStateSummary struct {
ID string `json:"id"`
Name string `json:"name"`
Color string `json:"color"`
Category string `json:"category"`
SortOrder int `json:"sortOrder"`
}
TaskStateSummary carries the state a task belongs to so tool consumers can group tasks by state without an extra fetch.
type TaskSummary ¶
type TaskSummary struct {
ID string `json:"id"`
Title string `json:"title"`
Description string `json:"description,omitempty"`
Priority string `json:"priority,omitempty"`
DueDate string `json:"dueDate,omitempty"`
StateID string `json:"stateId"`
Labels []TaskLabelSummary `json:"labels"`
Assignees []TaskAssigneeSummary `json:"assignees"`
Documents []TaskDocSummary `json:"documents"`
Rank float64 `json:"rank"`
}
TaskSummary is a self-contained task representation for tool consumers. All related fields (state, labels, assignees) are resolved server-side so the frontend can render the result without additional requests.
type TemplateLabel ¶
type TemplateState ¶
type TemplateSummary ¶
type TemplateSummary struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
States []TemplateState `json:"states"`
Labels []TemplateLabel `json:"labels"`
}