dto

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package dto provides data transfer objects for the API layer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChunkingConfigAttributes added in v1.2.1

type ChunkingConfigAttributes struct {
	ChunkSize    int `json:"chunk_size"`
	ChunkOverlap int `json:"chunk_overlap"`
	MinChunkSize int `json:"min_chunk_size"`
}

ChunkingConfigAttributes represents chunking configuration attributes in JSON:API format.

type ChunkingConfigData added in v1.2.1

type ChunkingConfigData struct {
	Type       string                   `json:"type"`
	Attributes ChunkingConfigAttributes `json:"attributes"`
}

ChunkingConfigData represents chunking configuration data in JSON:API format.

type ChunkingConfigResponse added in v1.2.1

type ChunkingConfigResponse struct {
	Data ChunkingConfigData `json:"data"`
}

ChunkingConfigResponse represents a chunking configuration response in JSON:API format.

type ChunkingConfigUpdateData added in v1.2.1

type ChunkingConfigUpdateData struct {
	Type       string                   `json:"type"`
	Attributes ChunkingConfigAttributes `json:"attributes"`
}

ChunkingConfigUpdateData represents chunking config update data.

type ChunkingConfigUpdateRequest added in v1.2.1

type ChunkingConfigUpdateRequest struct {
	Data ChunkingConfigUpdateData `json:"data"`
}

ChunkingConfigUpdateRequest represents a chunking config update request.

type CommitAttributes

type CommitAttributes struct {
	CommitSHA       string    `json:"commit_sha"`
	Date            time.Time `json:"date"`
	Message         string    `json:"message"`
	ParentCommitSHA string    `json:"parent_commit_sha"`
	Author          string    `json:"author"`
}

CommitAttributes represents commit attributes in JSON:API format.

type CommitData

type CommitData struct {
	Type       string           `json:"type"`
	ID         string           `json:"id"`
	Attributes CommitAttributes `json:"attributes"`
}

CommitData represents commit data in JSON:API format.

type CommitJSONAPIListResponse

type CommitJSONAPIListResponse struct {
	Data  []CommitData   `json:"data"`
	Meta  *jsonapi.Meta  `json:"meta,omitempty"`
	Links *jsonapi.Links `json:"links,omitempty"`
}

CommitJSONAPIListResponse represents a list of commits in JSON:API format.

type CommitJSONAPIResponse

type CommitJSONAPIResponse struct {
	Data CommitData `json:"data"`
}

CommitJSONAPIResponse represents a single commit in JSON:API format.

type EnrichmentAttributes

type EnrichmentAttributes struct {
	Type      string    `json:"type"`
	Subtype   string    `json:"subtype"`
	Content   string    `json:"content"`
	StartLine *int      `json:"start_line,omitempty"`
	EndLine   *int      `json:"end_line,omitempty"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

EnrichmentAttributes represents enrichment attributes in JSON:API format.

type EnrichmentData

type EnrichmentData struct {
	Type       string               `json:"type"`
	ID         string               `json:"id"`
	Attributes EnrichmentAttributes `json:"attributes"`
}

EnrichmentData represents enrichment data in JSON:API format.

type EnrichmentFilterRequest

type EnrichmentFilterRequest struct {
	Type       string   `json:"type,omitempty"`
	Subtype    string   `json:"subtype,omitempty"`
	SnippetIDs []string `json:"snippet_ids,omitempty"`
	CommitSHAs []string `json:"commit_shas,omitempty"`
}

EnrichmentFilterRequest represents filters for enrichment queries.

type EnrichmentJSONAPIListResponse

type EnrichmentJSONAPIListResponse struct {
	Data  []EnrichmentData `json:"data"`
	Meta  *jsonapi.Meta    `json:"meta,omitempty"`
	Links *jsonapi.Links   `json:"links,omitempty"`
}

EnrichmentJSONAPIListResponse represents a list of enrichments in JSON:API format.

type EnrichmentJSONAPIResponse

type EnrichmentJSONAPIResponse struct {
	Data EnrichmentData `json:"data"`
}

EnrichmentJSONAPIResponse represents a single enrichment in JSON:API format.

type EnrichmentListResponse

type EnrichmentListResponse struct {
	Data       []EnrichmentResponse `json:"data"`
	TotalCount int                  `json:"total_count"`
}

EnrichmentListResponse represents a list of enrichments.

type EnrichmentResponse

type EnrichmentResponse struct {
	ID        int64     `json:"id"`
	Type      string    `json:"type"`
	Subtype   string    `json:"subtype"`
	Content   string    `json:"content"`
	Language  string    `json:"language,omitempty"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

EnrichmentResponse represents an enrichment in API responses.

type EnrichmentSchema

type EnrichmentSchema struct {
	Type    string `json:"type"`
	Content string `json:"content"`
}

EnrichmentSchema represents an enrichment in search results.

type EnrichmentUpdateAttributes

type EnrichmentUpdateAttributes struct {
	Content string `json:"content"`
}

EnrichmentUpdateAttributes represents the attributes that can be updated.

type EnrichmentUpdateData

type EnrichmentUpdateData struct {
	Type       string                     `json:"type"`
	Attributes EnrichmentUpdateAttributes `json:"attributes"`
}

EnrichmentUpdateData represents the data for updating an enrichment.

type EnrichmentUpdateRequest

type EnrichmentUpdateRequest struct {
	Data EnrichmentUpdateData `json:"data"`
}

EnrichmentUpdateRequest represents a JSON:API request to update an enrichment.

type FileAttributes

type FileAttributes struct {
	BlobSHA   string `json:"blob_sha"`
	Path      string `json:"path"`
	MimeType  string `json:"mime_type"`
	Size      int64  `json:"size"`
	Extension string `json:"extension"`
}

FileAttributes represents file attributes in JSON:API format.

type FileData

type FileData struct {
	Type       string         `json:"type"`
	ID         string         `json:"id"`
	Attributes FileAttributes `json:"attributes"`
}

FileData represents file data in JSON:API format.

type FileJSONAPIListResponse

type FileJSONAPIListResponse struct {
	Data  []FileData     `json:"data"`
	Meta  *jsonapi.Meta  `json:"meta,omitempty"`
	Links *jsonapi.Links `json:"links,omitempty"`
}

FileJSONAPIListResponse represents a list of files in JSON:API format.

type FileJSONAPIResponse

type FileJSONAPIResponse struct {
	Data FileData `json:"data"`
}

FileJSONAPIResponse represents a single file in JSON:API format.

type GrepFileLinks struct {
	File string `json:"file"`
}

GrepFileLinks holds links for a grep result file.

type GrepFileSchema

type GrepFileSchema struct {
	Path     string            `json:"path"`
	Language string            `json:"language"`
	Matches  []GrepMatchSchema `json:"matches"`
	Links    *GrepFileLinks    `json:"links,omitempty"`
}

GrepFileSchema represents grep results for a single file.

type GrepMatchSchema

type GrepMatchSchema struct {
	Line    int    `json:"line"`
	Content string `json:"content"`
}

GrepMatchSchema represents a single line match from grep.

type GrepResponse

type GrepResponse struct {
	Data []GrepFileSchema `json:"data"`
}

GrepResponse is the response body for the grep endpoint.

type LegacyEnrichmentResponse

type LegacyEnrichmentResponse struct {
	ID        int64     `json:"id"`
	Type      string    `json:"type"`
	Subtype   string    `json:"subtype"`
	Content   string    `json:"content"`
	Language  string    `json:"language,omitempty"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

LegacyEnrichmentResponse is a legacy enrichment response type.

type LegacySearchRequest

type LegacySearchRequest struct {
	Query      string   `json:"query"`
	TextQuery  string   `json:"text_query,omitempty"`
	CodeQuery  string   `json:"code_query,omitempty"`
	Keywords   []string `json:"keywords,omitempty"`
	TopK       int      `json:"top_k,omitempty"`
	Language   string   `json:"language,omitempty"`
	Author     string   `json:"author,omitempty"`
	SourceRepo string   `json:"source_repo,omitempty"`
	FilePath   string   `json:"file_path,omitempty"`
	CommitSHAs []string `json:"commit_shas,omitempty"`
}

LegacySearchRequest represents a legacy search API request (flat format). Deprecated: Use SearchRequest for JSON:API compliance.

type LegacySearchResponse

type LegacySearchResponse struct {
	Results    []LegacySearchResultResponse `json:"results"`
	TotalCount int                          `json:"total_count"`
	Query      string                       `json:"query"`
}

LegacySearchResponse represents a legacy search API response. Deprecated: Use SearchResponse for JSON:API compliance.

type LegacySearchResultResponse

type LegacySearchResultResponse struct {
	SnippetSHA  string                     `json:"snippet_sha"`
	Content     string                     `json:"content"`
	Extension   string                     `json:"extension"`
	Score       float64                    `json:"score"`
	FilePath    string                     `json:"file_path,omitempty"`
	Language    string                     `json:"language,omitempty"`
	Enrichments []LegacyEnrichmentResponse `json:"enrichments,omitempty"`
}

LegacySearchResultResponse represents a legacy single search result. Deprecated: Use SnippetData for JSON:API compliance.

type LegacyTaskListResponse

type LegacyTaskListResponse struct {
	Data       []LegacyTaskResponse `json:"data"`
	TotalCount int                  `json:"total_count"`
}

LegacyTaskListResponse represents a legacy list of tasks. Deprecated: Use TaskListResponse for JSON:API compliance.

type LegacyTaskResponse

type LegacyTaskResponse struct {
	ID        int64     `json:"id"`
	DedupKey  string    `json:"dedup_key"`
	Operation string    `json:"operation"`
	Priority  int       `json:"priority"`
	Payload   any       `json:"payload,omitempty"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

LegacyTaskResponse represents a legacy task in API responses. Deprecated: Use TaskResponse for JSON:API compliance.

type LsFileAttributes

type LsFileAttributes struct {
	Path string `json:"path"`
	Size int64  `json:"size"`
}

LsFileAttributes holds attributes for a file in an ls response.

type LsFileData

type LsFileData struct {
	Type       string           `json:"type"`
	ID         string           `json:"id"`
	Attributes LsFileAttributes `json:"attributes"`
	Links      LsFileLinks      `json:"links"`
}

LsFileData represents a single file entry in an ls response.

type LsFileLinks struct {
	Self string `json:"self"`
}

LsFileLinks holds links for a file in an ls response.

type LsResponse

type LsResponse struct {
	Data  []LsFileData   `json:"data"`
	Meta  *jsonapi.Meta  `json:"meta,omitempty"`
	Links *jsonapi.Links `json:"links,omitempty"`
}

LsResponse represents the response for a file listing.

type RepositoryAttributes

type RepositoryAttributes struct {
	RemoteURI      string     `json:"remote_uri"`
	UpstreamURL    string     `json:"upstream_url"` // The canonical upstream URL (e.g. github.com/org/repo); falls back to remote_uri when not set
	CreatedAt      *time.Time `json:"created_at,omitempty"`
	UpdatedAt      *time.Time `json:"updated_at,omitempty"`
	LastScannedAt  *time.Time `json:"last_scanned_at,omitempty"`
	ClonedPath     *string    `json:"cloned_path,omitempty"`
	TrackingBranch *string    `json:"tracking_branch,omitempty"`
	NumCommits     int        `json:"num_commits"`
	NumBranches    int        `json:"num_branches"`
	NumTags        int        `json:"num_tags"`
}

RepositoryAttributes represents repository attributes in JSON:API format.

type RepositoryBranchData

type RepositoryBranchData struct {
	Name        string `json:"name"`
	IsDefault   bool   `json:"is_default"`
	CommitCount int    `json:"commit_count"`
}

RepositoryBranchData represents branch data for repository details.

type RepositoryCommitData

type RepositoryCommitData struct {
	SHA       string    `json:"sha"`
	Message   string    `json:"message"`
	Author    string    `json:"author"`
	Timestamp time.Time `json:"timestamp"`
}

RepositoryCommitData represents commit data for repository details.

type RepositoryCreateAttributes

type RepositoryCreateAttributes struct {
	RemoteURI   string `json:"remote_uri"`
	UpstreamURL string `json:"upstream_url,omitempty"` // Optional canonical upstream URL; used for deduplication when multiple clone URLs point to the same repo
}

RepositoryCreateAttributes represents repository creation attributes.

type RepositoryCreateData

type RepositoryCreateData struct {
	Type       string                     `json:"type"`
	Attributes RepositoryCreateAttributes `json:"attributes"`
}

RepositoryCreateData represents repository creation data.

type RepositoryCreateRequest

type RepositoryCreateRequest struct {
	Data RepositoryCreateData `json:"data"`
}

RepositoryCreateRequest represents a repository creation request in JSON:API format.

type RepositoryData

type RepositoryData struct {
	Type       string               `json:"type"`
	ID         string               `json:"id"`
	Attributes RepositoryAttributes `json:"attributes"`
}

RepositoryData represents repository data in JSON:API format.

type RepositoryDetailsResponse

type RepositoryDetailsResponse struct {
	Data          RepositoryData         `json:"data"`
	Branches      []RepositoryBranchData `json:"branches"`
	RecentCommits []RepositoryCommitData `json:"recent_commits"`
}

RepositoryDetailsResponse represents repository details with branches and commits.

type RepositoryListResponse

type RepositoryListResponse struct {
	Data  []RepositoryData `json:"data"`
	Meta  *jsonapi.Meta    `json:"meta,omitempty"`
	Links *jsonapi.Links   `json:"links,omitempty"`
}

RepositoryListResponse represents a list of repositories in JSON:API format.

type RepositoryRequest

type RepositoryRequest struct {
	RemoteURL string `json:"remote_url"`
	Branch    string `json:"branch,omitempty"`
	Tag       string `json:"tag,omitempty"`
	Commit    string `json:"commit,omitempty"`
}

RepositoryRequest represents a legacy request to add a repository. Deprecated: Use RepositoryCreateRequest for JSON:API compliance.

type RepositoryResponse

type RepositoryResponse struct {
	Data RepositoryData `json:"data"`
}

RepositoryResponse represents a single repository response in JSON:API format.

type RepositoryStatusSummaryAttributes

type RepositoryStatusSummaryAttributes struct {
	Status    string    `json:"status"`
	Message   string    `json:"message"`
	UpdatedAt time.Time `json:"updated_at"`
}

RepositoryStatusSummaryAttributes represents status summary attributes.

type RepositoryStatusSummaryData

type RepositoryStatusSummaryData struct {
	Type       string                            `json:"type"`
	ID         string                            `json:"id"`
	Attributes RepositoryStatusSummaryAttributes `json:"attributes"`
}

RepositoryStatusSummaryData represents status summary data in JSON:API format.

type RepositoryStatusSummaryResponse

type RepositoryStatusSummaryResponse struct {
	Data RepositoryStatusSummaryData `json:"data"`
}

RepositoryStatusSummaryResponse represents a repository status summary response.

type SearchAttributes

type SearchAttributes struct {
	Keywords []string       `json:"keywords,omitempty"`
	Code     *string        `json:"code,omitempty"`
	Text     *string        `json:"text,omitempty"`
	Limit    *int           `json:"limit,omitempty"`
	Filters  *SearchFilters `json:"filters,omitempty"`
}

SearchAttributes represents search request attributes in JSON:API format.

type SearchData

type SearchData struct {
	Type       string           `json:"type"`
	Attributes SearchAttributes `json:"attributes"`
}

SearchData represents search request data in JSON:API format.

type SearchFilters

type SearchFilters struct {
	Languages          []string   `json:"languages,omitempty"`
	Authors            []string   `json:"authors,omitempty"`
	StartDate          *time.Time `json:"start_date,omitempty"`
	EndDate            *time.Time `json:"end_date,omitempty"`
	Sources            []string   `json:"sources,omitempty"`
	FilePatterns       []string   `json:"file_patterns,omitempty"`
	EnrichmentTypes    []string   `json:"enrichment_types,omitempty"`
	EnrichmentSubtypes []string   `json:"enrichment_subtypes,omitempty"`
	CommitSHA          []string   `json:"commit_sha,omitempty"`
}

SearchFilters represents search filters in JSON:API format.

type SearchRequest

type SearchRequest struct {
	Data SearchData `json:"data"`
}

SearchRequest represents a JSON:API search request.

type SearchResponse

type SearchResponse struct {
	Data []SnippetData `json:"data"`
}

SearchResponse represents a search API response in JSON:API format.

type SnippetAttributes

type SnippetAttributes struct {
	CreatedAt      *time.Time           `json:"created_at,omitempty"`
	UpdatedAt      *time.Time           `json:"updated_at,omitempty"`
	Content        SnippetContentSchema `json:"content"`
	Enrichments    []EnrichmentSchema   `json:"enrichments"`
	OriginalScores []float64            `json:"original_scores"`
}

SnippetAttributes represents snippet attributes in search results.

type SnippetContentSchema

type SnippetContentSchema struct {
	Value     string `json:"value"`
	Language  string `json:"language"`
	StartLine *int   `json:"start_line,omitempty"`
	EndLine   *int   `json:"end_line,omitempty"`
}

SnippetContentSchema represents snippet content in search results.

type SnippetData

type SnippetData struct {
	Type       string            `json:"type"`
	ID         string            `json:"id"`
	Attributes SnippetAttributes `json:"attributes"`
	Links      *SnippetLinks     `json:"links,omitempty"`
}

SnippetData represents snippet data in JSON:API format.

type SnippetLinks struct {
	Repository string `json:"repository,omitempty"`
	Commit     string `json:"commit,omitempty"`
	File       string `json:"file,omitempty"`
}

SnippetLinks holds API path links for a search result snippet.

type SnippetListResponse

type SnippetListResponse struct {
	Data  []SnippetData  `json:"data"`
	Meta  *jsonapi.Meta  `json:"meta,omitempty"`
	Links *jsonapi.Links `json:"links,omitempty"`
}

SnippetListResponse represents a list of snippets in JSON:API format.

type TagAttributes

type TagAttributes struct {
	Name            string `json:"name"`
	TargetCommitSHA string `json:"target_commit_sha"`
	IsVersionTag    bool   `json:"is_version_tag"`
}

TagAttributes represents tag attributes in JSON:API format.

type TagData

type TagData struct {
	Type       string        `json:"type"`
	ID         string        `json:"id"`
	Attributes TagAttributes `json:"attributes"`
}

TagData represents tag data in JSON:API format.

type TagJSONAPIListResponse

type TagJSONAPIListResponse struct {
	Data  []TagData      `json:"data"`
	Meta  *jsonapi.Meta  `json:"meta,omitempty"`
	Links *jsonapi.Links `json:"links,omitempty"`
}

TagJSONAPIListResponse represents a list of tags in JSON:API format.

type TagJSONAPIResponse

type TagJSONAPIResponse struct {
	Data TagData `json:"data"`
}

TagJSONAPIResponse represents a single tag in JSON:API format.

type TaskAttributes

type TaskAttributes struct {
	Type      string     `json:"type"`
	Priority  int        `json:"priority"`
	Payload   any        `json:"payload"`
	CreatedAt *time.Time `json:"created_at,omitempty"`
	UpdatedAt *time.Time `json:"updated_at,omitempty"`
}

TaskAttributes represents task attributes in JSON:API format.

type TaskData

type TaskData struct {
	Type       string         `json:"type"`
	ID         string         `json:"id"`
	Attributes TaskAttributes `json:"attributes"`
}

TaskData represents task data in JSON:API format.

type TaskListResponse

type TaskListResponse struct {
	Data  []TaskData     `json:"data"`
	Meta  *jsonapi.Meta  `json:"meta,omitempty"`
	Links *jsonapi.Links `json:"links,omitempty"`
}

TaskListResponse represents a list of tasks in JSON:API format.

type TaskResponse

type TaskResponse struct {
	Data TaskData `json:"data"`
}

TaskResponse represents a single task response in JSON:API format.

type TaskStatusAttributes

type TaskStatusAttributes struct {
	Step      string     `json:"step"`
	State     string     `json:"state"`
	Progress  float64    `json:"progress"`
	Total     int        `json:"total"`
	Current   int        `json:"current"`
	CreatedAt *time.Time `json:"created_at,omitempty"`
	UpdatedAt *time.Time `json:"updated_at,omitempty"`
	Error     string     `json:"error"`
	Message   string     `json:"message"`
}

TaskStatusAttributes represents task status attributes in JSON:API format.

type TaskStatusData

type TaskStatusData struct {
	Type       string               `json:"type"`
	ID         string               `json:"id"`
	Attributes TaskStatusAttributes `json:"attributes"`
}

TaskStatusData represents task status data in JSON:API format.

type TaskStatusListResponse

type TaskStatusListResponse struct {
	Data  []TaskStatusData `json:"data"`
	Meta  *jsonapi.Meta    `json:"meta,omitempty"`
	Links *jsonapi.Links   `json:"links,omitempty"`
}

TaskStatusListResponse represents a list of task statuses in JSON:API format.

type TaskStatusResponse

type TaskStatusResponse struct {
	ID           int64      `json:"id"`
	TaskID       int64      `json:"task_id"`
	ParentID     int64      `json:"parent_id,omitempty"`
	State        string     `json:"state"`
	ErrorMessage string     `json:"error_message,omitempty"`
	StartedAt    *time.Time `json:"started_at,omitempty"`
	CompletedAt  *time.Time `json:"completed_at,omitempty"`
	CreatedAt    time.Time  `json:"created_at"`
	UpdatedAt    time.Time  `json:"updated_at"`
}

TaskStatusResponse represents a task status in API responses.

type TrackingConfigAttributes

type TrackingConfigAttributes struct {
	Mode  TrackingMode `json:"mode"`
	Value *string      `json:"value,omitempty"`
}

TrackingConfigAttributes represents tracking configuration attributes in JSON:API format.

type TrackingConfigData

type TrackingConfigData struct {
	Type       string                   `json:"type"`
	Attributes TrackingConfigAttributes `json:"attributes"`
}

TrackingConfigData represents tracking configuration data in JSON:API format.

type TrackingConfigRequest

type TrackingConfigRequest struct {
	Branch string `json:"branch,omitempty"`
	Tag    string `json:"tag,omitempty"`
	Commit string `json:"commit,omitempty"`
}

TrackingConfigRequest represents a legacy request to update tracking configuration. Deprecated: Use TrackingConfigUpdateRequest for JSON:API compliance.

type TrackingConfigResponse

type TrackingConfigResponse struct {
	Data TrackingConfigData `json:"data"`
}

TrackingConfigResponse represents a tracking configuration response in JSON:API format.

type TrackingConfigUpdateAttributes

type TrackingConfigUpdateAttributes struct {
	Mode  TrackingMode `json:"mode"`
	Value *string      `json:"value,omitempty"`
}

TrackingConfigUpdateAttributes represents tracking config update attributes.

type TrackingConfigUpdateData

type TrackingConfigUpdateData struct {
	Type       string                         `json:"type"`
	Attributes TrackingConfigUpdateAttributes `json:"attributes"`
}

TrackingConfigUpdateData represents tracking config update data.

type TrackingConfigUpdateRequest

type TrackingConfigUpdateRequest struct {
	Data TrackingConfigUpdateData `json:"data"`
}

TrackingConfigUpdateRequest represents a tracking config update request.

type TrackingMode

type TrackingMode string

TrackingMode represents the tracking mode (branch or tag).

const (
	TrackingModeBranch TrackingMode = "branch"
	TrackingModeTag    TrackingMode = "tag"
)

type WikiTreeNode

type WikiTreeNode struct {
	Slug     string         `json:"slug"`
	Title    string         `json:"title"`
	Path     string         `json:"path"`
	Children []WikiTreeNode `json:"children,omitempty"`
}

WikiTreeNode represents a wiki page in the navigation tree (no content).

type WikiTreeResponse

type WikiTreeResponse struct {
	Data []WikiTreeNode `json:"data"`
}

WikiTreeResponse is the JSON response for the wiki tree endpoint.

Jump to

Keyboard shortcuts

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