api

package
v0.1.18-rc3 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package api defines canonical domain-level DTO types for shared API payloads. These types are the authoritative definitions for wire shapes that cross the server/client/cli boundary. Handlers encode them; clients and CLI decode them.

Ownership rules:

  • Types here are stable across server, client, and CLI boundaries.
  • JSON field names must not change without a coordinated wire-format migration.
  • Handler-local and CLI-local mirrors of these shapes are superseded by this package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateMigRunRequest added in v0.1.16

type CreateMigRunRequest struct {
	RepoSelector MigRepoSelector `json:"repo_selector"`
	CreatedBy    *string         `json:"created_by,omitempty"`

	GitLabToken *string `json:"gitlab_token,omitempty"`
}

type CreateSingleRepoRunResponse

type CreateSingleRepoRunResponse struct {
	WaveID domaintypes.WaveID `json:"wave_id"`
	RunID  domaintypes.RunID  `json:"run_id"`
	MigID  domaintypes.MigID  `json:"mig_id"`
	SpecID domaintypes.SpecID `json:"spec_id"`
}

CreateSingleRepoRunResponse is returned by POST /v1/runs.

type MigListResponse

type MigListResponse struct {
	Migs []MigSummary `json:"migs"`
}

MigListResponse is the canonical response envelope for GET /v1/migs.

type MigRepoListResponse

type MigRepoListResponse struct {
	Repos []MigRepoSummary `json:"repos"`
}

MigRepoListResponse is the canonical response envelope for GET /v1/migs/{id}/repos.

type MigRepoSelector added in v0.1.16

type MigRepoSelector struct {
	Mode  string                `json:"mode"`
	Repos []domaintypes.RepoURL `json:"repos,omitempty"`
}

type MigRepoSummary

type MigRepoSummary struct {
	ID        domaintypes.MigRepoID `json:"id"`
	MigID     domaintypes.MigID     `json:"mig_id"`
	RepoURL   string                `json:"repo_url"`
	BaseRef   string                `json:"base_ref"`
	CreatedAt time.Time             `json:"created_at"`
}

MigRepoSummary is the canonical DTO for a single repo entry within a mig's repo set. It is the authoritative response shape for:

  • GET /v1/migs/{id}/repos — individual items in the repo list
  • POST /v1/migs/{id}/repos — the added repo in the 201 response

Wire shape is stable: JSON field names must not change.

type MigSummary

type MigSummary struct {
	ID        domaintypes.MigID   `json:"id"`
	Name      string              `json:"name"`
	SpecID    *domaintypes.SpecID `json:"spec_id,omitempty"`
	CreatedBy *string             `json:"created_by,omitempty"`
	Archived  bool                `json:"archived"`
	CreatedAt time.Time           `json:"created_at"`
}

MigSummary is the canonical DTO for a single mig project entry. It is the authoritative response shape for:

  • GET /v1/migs — individual items in the mig list
  • POST /v1/migs — the created mig in the 201 response

Wire shape is stable: JSON field names must not change.

type NamedSpecCatalogEntry

type NamedSpecCatalogEntry struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Source      string `json:"source"`
	Path        string `json:"path"`
	SHA         string `json:"sha"`
}

NamedSpecCatalogEntry identifies a named spec discovered from a Git repository.

type NamedSpecListResponse

type NamedSpecListResponse struct {
	Specs []NamedSpecCatalogEntry `json:"specs"`
}

NamedSpecListResponse is returned by GET /v1/specs.

type RunBuildGateForcedOverrides

type RunBuildGateForcedOverrides struct {
	Pre  *RunBuildGateForcedStack `json:"pre,omitempty"`
	Post *RunBuildGateForcedStack `json:"post,omitempty"`
}

type RunBuildGateForcedStack

type RunBuildGateForcedStack struct {
	Language string `json:"language"`
	Release  string `json:"release"`
	Tool     string `json:"tool,omitempty"`
}

type RunRestartRequest added in v0.1.16

type RunRestartRequest struct {
	GitLabToken *string `json:"gitlab_token,omitempty"`
}

type RunSpecOverrides

type RunSpecOverrides struct {
	StepEnvs        map[string][]string          `json:"step_envs,omitempty"`
	BuildGateForced *RunBuildGateForcedOverrides `json:"build_gate_forced,omitempty"`
}

RunSpecOverrides contains mutations that the server applies only to a named spec after it compiles the selected repository source.

type RunSubmitRequest

type RunSubmitRequest struct {
	RepoURL       domaintypes.RepoURL `json:"repo_url"`
	Ref           domaintypes.GitRef  `json:"ref"`
	CommitSHA     string              `json:"commit_sha,omitempty"`
	Spec          json.RawMessage     `json:"spec,omitempty"`
	SpecSelector  string              `json:"spec_selector,omitempty"`
	SpecOverrides *RunSpecOverrides   `json:"spec_overrides,omitempty"`
	CreatedBy     string              `json:"created_by,omitempty"`

	GitLabToken *string `json:"gitlab_token,omitempty"`
}

RunSubmitRequest is the canonical request DTO for POST /v1/runs. It is the authoritative shape for single-repo run submission shared between the server handler and CLI clients.

Wire shape is stable: JSON field names must not change.

Jump to

Keyboard shortcuts

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