api

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	StatusCode int    `json:"status_code"`
	Message    string `json:"message"`
	Detail     string `json:"detail,omitempty"`
}

func (*APIError) Error

func (e *APIError) Error() string

type BoardColumn

type BoardColumn struct {
	Status  string           `json:"status"`
	Count   int              `json:"count"`
	Tickets []TicketResponse `json:"tickets"`
}

type BoardView

type BoardView struct {
	Columns []BoardColumn `json:"columns"`
	Total   int           `json:"total"`
}

type Client

type Client struct {
	BaseURL    string
	AuthToken  string
	UserAgent  string
	HTTPClient *http.Client
	Verbose    bool
}

func NewClient

func NewClient(baseURL, authToken string, verbose bool) *Client
func (c *Client) AddLink(project string, ticketID int, req LinkCreate) (*TicketLinkResp, error)

func (*Client) CreateProject

func (c *Client) CreateProject(req ProjectCreate) (*ProjectResponse, error)

func (*Client) CreateTicket

func (c *Client) CreateTicket(project string, req TicketCreate) (*TicketResponse, error)

func (*Client) Delete

func (c *Client) Delete(path string, params url.Values) error

func (*Client) DeleteProject

func (c *Client) DeleteProject(name string) error

func (*Client) DeleteWithResult

func (c *Client) DeleteWithResult(path string, params url.Values, result any) error

DeleteWithResult performs a DELETE and decodes the JSON response body. Use for endpoints that return data (e.g. context unlock returns ContextDeleteResponse).

func (*Client) Do

func (c *Client) Do(method, path string, body any, params url.Values) ([]byte, int, error)

func (*Client) Get

func (c *Client) Get(path string, params url.Values, result any) error

func (*Client) GetBoard

func (c *Client) GetBoard(project string, view, ticketType, status string) (*BoardView, error)

func (*Client) GetContext

func (c *Client) GetContext(project, topic string, version string) (*ContextDetailResponse, error)

func (*Client) GetProject

func (c *Client) GetProject(name string, withStats bool) (*ProjectResponse, error)

func (*Client) GetTicket

func (c *Client) GetTicket(project string, id int) (*TicketResponse, error)

func (*Client) ListContexts

func (c *Client) ListContexts(project string, priority, tags string, limit, offset int) (*ContextListResponse, error)
func (c *Client) ListLinks(project string, ticketID int) ([]TicketLinkResp, error)

func (*Client) ListProjects

func (c *Client) ListProjects(withStats bool) (*ProjectListResponse, error)

func (*Client) ListTickets

func (c *Client) ListTickets(project string, status, ticketType, priority string, limit, offset int) (*TicketListResponse, error)

func (*Client) LockContext

func (c *Client) LockContext(project string, req ContextCreateRequest) (*ContextCreateResponse, error)

func (*Client) MoveContext

func (c *Client) MoveContext(project, topic, targetProject string) (*ContextMoveResponse, error)

func (*Client) Post

func (c *Client) Post(path string, body any, result any) error

func (*Client) Put

func (c *Client) Put(path string, body any, result any) error
func (c *Client) RemoveLink(project string, ticketID, linkID int) error

func (*Client) SearchContexts

func (c *Client) SearchContexts(project, query string, limit int) (*ContextListResponse, error)

func (*Client) SearchTickets

func (c *Client) SearchTickets(project, query string, ticketType, status string, limit int) (*TicketSearchResponse, error)

func (*Client) TransitionTicket

func (c *Client) TransitionTicket(project string, id int, status string) (*TicketResponse, error)

func (*Client) UnlockContext

func (c *Client) UnlockContext(project, topic string, version string, force, noArchive bool) (*ContextDeleteResponse, error)

func (*Client) UpdateContext

func (c *Client) UpdateContext(project, topic string, req ContextUpdateRequest) (*ContextResponse, error)

func (*Client) UpdateTicket

func (c *Client) UpdateTicket(project string, id int, req TicketUpdate) (*TicketResponse, error)

type ContextCreateRequest

type ContextCreateRequest struct {
	Topic      string `json:"topic"`
	Content    string `json:"content"`
	Priority   string `json:"priority,omitempty"`
	Tags       string `json:"tags,omitempty"`
	ForceStore bool   `json:"force_store,omitempty"`
}

type ContextCreateResponse

type ContextCreateResponse struct {
	Status  string `json:"status"`
	Topic   string `json:"topic"`
	Version string `json:"version"`
}

type ContextDeleteResponse

type ContextDeleteResponse struct {
	Status   string `json:"status"`
	Topic    string `json:"topic"`
	Archived bool   `json:"archived"`
}

type ContextDetailResponse

type ContextDetailResponse struct {
	ContextResponse
	Content  string           `json:"content"`
	Versions []VersionSummary `json:"versions,omitempty"`
}

type ContextListResponse

type ContextListResponse struct {
	Contexts []ContextResponse `json:"contexts"`
	Total    int               `json:"total"`
}

type ContextMoveResponse

type ContextMoveResponse struct {
	Status        string `json:"status"`
	Topic         string `json:"topic"`
	TargetProject string `json:"target_project"`
}

type ContextResponse

type ContextResponse struct {
	ID           int        `json:"id"`
	Topic        string     `json:"topic"`
	Version      string     `json:"version"`
	Priority     string     `json:"priority"`
	Tags         []string   `json:"tags"`
	Preview      *string    `json:"preview,omitempty"`
	KeyConcepts  []string   `json:"key_concepts,omitempty"`
	ContentHash  *string    `json:"content_hash,omitempty"`
	LockedAt     *time.Time `json:"locked_at,omitempty"`
	LastAccessed *time.Time `json:"last_accessed,omitempty"`
	AccessCount  int        `json:"access_count"`
}

type ContextUpdateRequest

type ContextUpdateRequest struct {
	Content  string `json:"content,omitempty"`
	Priority string `json:"priority,omitempty"`
	Tags     string `json:"tags,omitempty"`
}

type LinkCreate

type LinkCreate struct {
	TargetID int    `json:"target_id"`
	LinkType string `json:"link_type"`
}

type ProjectCreate

type ProjectCreate struct {
	Name        string  `json:"name"`
	Description *string `json:"description,omitempty"`
}

type ProjectListResponse

type ProjectListResponse struct {
	Projects []ProjectResponse `json:"projects"`
	Total    int               `json:"total"`
}

type ProjectResponse

type ProjectResponse struct {
	Name        string        `json:"name"`
	SchemaName  string        `json:"schema_name"`
	CreatedAt   time.Time     `json:"created_at"`
	Role        string        `json:"role"`
	IsSystem    bool          `json:"is_system"`
	Description *string       `json:"description,omitempty"`
	Stats       *ProjectStats `json:"stats,omitempty"`
}

type ProjectStats

type ProjectStats struct {
	ContextCount   int        `json:"context_count"`
	SessionCount   int        `json:"session_count"`
	FileCount      int        `json:"file_count"`
	StorageBytesDB int        `json:"storage_bytes_db"`
	StorageBytesS3 int        `json:"storage_bytes_s3"`
	LastActivity   *time.Time `json:"last_activity,omitempty"`
}

type TicketCreate

type TicketCreate struct {
	Title       string         `json:"title"`
	Description *string        `json:"description,omitempty"`
	Type        string         `json:"type"`
	Priority    string         `json:"priority"`
	Assignee    *string        `json:"assignee,omitempty"`
	Tags        []string       `json:"tags,omitempty"`
	Metadata    map[string]any `json:"metadata,omitempty"`
}

type TicketHistory

type TicketHistory struct {
	Action    string  `json:"action"`
	Field     string  `json:"field,omitempty"`
	OldValue  *string `json:"old_value,omitempty"`
	NewValue  *string `json:"new_value,omitempty"`
	Timestamp float64 `json:"timestamp"`
}

type TicketLinkResp

type TicketLinkResp struct {
	ID           int    `json:"id"`
	SourceID     int    `json:"source_id"`
	TargetID     int    `json:"target_id"`
	LinkType     string `json:"link_type"`
	TargetTitle  string `json:"target_title,omitempty"`
	TargetStatus string `json:"target_status,omitempty"`
}

type TicketListResponse

type TicketListResponse struct {
	Tickets []TicketResponse `json:"tickets"`
	Total   int              `json:"total"`
}

type TicketResponse

type TicketResponse struct {
	ID          int              `json:"id"`
	Title       string           `json:"title"`
	Description *string          `json:"description,omitempty"`
	Type        string           `json:"type"`
	Status      string           `json:"status"`
	Priority    string           `json:"priority"`
	Assignee    *string          `json:"assignee,omitempty"`
	Tags        []string         `json:"tags,omitempty"`
	CreatedAt   *float64         `json:"created_at,omitempty"`
	UpdatedAt   *float64         `json:"updated_at,omitempty"`
	ClosedAt    *float64         `json:"closed_at,omitempty"`
	History     []TicketHistory  `json:"history,omitempty"`
	Links       []TicketLinkResp `json:"links,omitempty"`
}

type TicketSearchResponse

type TicketSearchResponse struct {
	Results []TicketResponse `json:"tickets"`
	Total   int              `json:"total"`
	Query   string           `json:"query"`
}

type TicketUpdate

type TicketUpdate struct {
	Title       *string  `json:"title,omitempty"`
	Description *string  `json:"description,omitempty"`
	Priority    *string  `json:"priority,omitempty"`
	Assignee    *string  `json:"assignee,omitempty"`
	Tags        []string `json:"tags,omitempty"`
}

type TransitionRequest

type TransitionRequest struct {
	Status string `json:"status"`
}

type VersionSummary

type VersionSummary struct {
	Version   string     `json:"version"`
	CreatedAt *time.Time `json:"created_at,omitempty"`
}

Jump to

Keyboard shortcuts

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