Documentation
¶
Overview ¶
Package envelope holds the typed per-operation Output structs that envelope `data` payloads are built from, and derives the published JSON Schemas from those same types — one declaration, so emission and schema cannot diverge. It sits below internal/cli in the import graph: wire-type imports (internal/jira, internal/adf) are allowed, internal/cli is NOT — cli imports this package (Pagination's canonical home is here, aliased there), so an envelope→cli import closes a cycle.
Index ¶
- func Doc(op string) map[string]any
- func Outputs() map[string]any
- func Registered() []string
- func SchemaOf(v any, overrides map[string]any) map[string]any
- type ADFRenderOutput
- type AliasDeleteOutput
- type AliasImportOutput
- type AliasListOutput
- type AliasSetOutput
- type AuthLoginOutput
- type AuthLogoutOutput
- type AuthMigrateOutput
- type AuthRefreshOutput
- type AuthSwitchOutput
- type AuthTokenOutput
- type AuthWhoamiOutput
- type BoardRow
- type BoardsListOutput
- type CacheBoardsOutput
- type CacheClearOutput
- type CacheIssueKeysOutput
- type CacheRefreshRow
- type ConfigGetOutput
- type ConfigInitOutput
- type ConfigProfileEntry
- type ConfigProfileOutput
- type ConfigSetOutput
- type ConfigThemeOutput
- type Dynamic
- type EpicAddOutput
- type EpicBoardOutput
- type EpicBoardRow
- type EpicListOutput
- type EpicRemoveOutput
- type IssueAttachmentAddOutput
- type IssueAttachmentDeleteOutput
- type IssueAttachmentDownloadOutput
- type IssueAttachmentListOutput
- type IssueCommentAddOutput
- type IssueCommentDeleteOutput
- type IssueCommentEditOutput
- type IssueCommentListOutput
- type IssueCreateOutput
- type IssueDestructiveOutput
- type IssueEditOutput
- type IssueLinkCreateOutput
- type IssueLinkDeleteOutput
- type IssueLinkListOutput
- type IssueLinkTypesOutput
- type IssueListAssignee
- type IssueListOutput
- type IssueListRow
- type IssueRankOutput
- type IssueRef
- type IssueTransitionOutput
- type IssueTransitionsOutput
- type IssueViewOutput
- type IssueWatcherMutationOutput
- type IssueWatchersListOutput
- type IssueWebLinkOutput
- type JQLBuildOutput
- type JQLReferenceField
- type JQLReferenceFunction
- type JQLReferenceOutput
- type JQLValidateEntry
- type JQLValidateOutput
- type MeOutput
- type Pagination
- type SearchCountOutput
- type SearchJQLOutput
- type SearchSavedOutput
- type UpdateOutput
- type UserSearchMatch
- type UserSearchOutput
- type VersionOutput
- type WebOpenIssueOutput
- type WebOpenSearchOutput
- type WorklogAddOutput
- type WorklogDraft
- type WorklogListOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Outputs ¶
Outputs returns a copy of the registration map for schema derivation: callers derive each op's published schema from the registered zero value.
func Registered ¶
func Registered() []string
Registered returns the operation names with typed outputs, sorted.
func SchemaOf ¶
SchemaOf derives the published JSON-Schema map for an Output struct from its type: object properties from exported fields' json tags, `required` from fields without omitempty, recursion through structs and slices, `map[string]…` and `any` as opaque objects/values. `overrides` deep-merges on top — the home for descriptions, formats, and enum refinements the type system cannot express — so the shape always comes from the struct and only prose comes from prose.
Derivation rules, chosen to match how encoding/json actually emits:
- json:"-" fields are skipped; unexported fields are skipped.
- omitempty ⇒ optional (absent from required).
- a pointer without omitempty marshals as null when nil ⇒ type gains the "null" alternative.
- embedded structs inline their fields, as encoding/json does.
Types ¶
type ADFRenderOutput ¶
type ADFRenderOutput struct {
Markdown string `json:"markdown"`
Lossy bool `json:"lossy"`
LossyConstructs []string `json:"lossy_constructs"`
}
ADFRenderOutput is `adf render`'s envelope data: the lossy Markdown projection of an ADF document, whether the projection dropped anything, and the named constructs that degraded.
type AliasDeleteOutput ¶
type AliasDeleteOutput struct {
Name string `json:"name"`
Deleted bool `json:"deleted"`
DryRun bool `json:"dry_run"`
}
AliasDeleteOutput is `alias delete`'s envelope data: the alias targeted and whether it existed (false when nothing was removed).
type AliasImportOutput ¶
type AliasImportOutput struct {
Imported int `json:"imported"`
Aliases []string `json:"aliases"`
Skipped map[string]string `json:"skipped"`
DryRun bool `json:"dry_run"`
}
AliasImportOutput is `alias import`'s envelope data: how many aliases merged, their names, and the per-name reason for every skipped entry.
type AliasListOutput ¶
AliasListOutput is `alias list`'s envelope data: the config's alias name→expansion map, wrapped so the payload is an object, with a count that spares consumers a keys-length dance.
type AliasSetOutput ¶
type AliasSetOutput struct {
Name string `json:"name"`
Expansion string `json:"expansion"`
Previous string `json:"previous"`
DryRun bool `json:"dry_run"`
}
AliasSetOutput is `alias set`'s envelope data: the alias written and the expansion it replaced (empty on a fresh alias). dry_run previews without writing the config file.
type AuthLoginOutput ¶
type AuthLoginOutput struct {
Profile string `json:"profile"`
AuthType string `json:"auth_type"`
TokenType string `json:"token_type"`
Scoped bool `json:"scoped"`
SecretBackend string `json:"secret_backend"`
OnePasswordAccount string `json:"onepassword_account"`
StoredSecret bool `json:"stored_secret"`
Verified bool `json:"verified"`
SkipVerify bool `json:"skip_verify"`
CredentialEnv string `json:"credential_env,omitempty"`
CloudID string `json:"cloud_id,omitempty"`
AccountID *string `json:"account_id,omitempty"`
DisplayName *string `json:"display_name,omitempty"`
BoardsCached *int `json:"boards_cached,omitempty"`
}
AuthLoginOutput is `auth login`'s envelope data: the configured profile and how its credential was stored and verified. Credential material never appears here — only where the token lives and whether it authenticated. The account_id/display_name pair is present exactly when verified is true (a verified /myself), so both are pointers set together; the env-backend credential_env, a scoped token's cloud_id, and the login-warmed boards_cached appear only on the paths that produce them.
type AuthLogoutOutput ¶
type AuthLogoutOutput struct {
Profile string `json:"profile"`
Backend string `json:"backend"`
Removed bool `json:"removed"`
DryRun bool `json:"dry_run"`
}
AuthLogoutOutput is `auth logout`'s envelope data: which profile's credential was targeted, its backend, and whether anything was removed (false on both the dry-run preview and an already-absent credential).
type AuthMigrateOutput ¶
type AuthMigrateOutput struct {
TargetBackend string `json:"target_backend"`
DryRun bool `json:"dry_run"`
Profiles []map[string]any `json:"profiles"`
CleanupFailures []string `json:"cleanup_failures,omitempty"`
CleanupNotes []string `json:"cleanup_notes,omitempty"`
}
AuthMigrateOutput is `jira auth migrate`'s envelope data: the per-profile migration report plus any cleanup diagnostics. Profiles rows are built per-backend with varying keys, so they stay dynamic.
type AuthRefreshOutput ¶
type AuthRefreshOutput struct {
Profile string `json:"profile"`
AuthType string `json:"auth_type"`
Refreshed bool `json:"refreshed"`
Reason string `json:"reason"`
}
AuthRefreshOutput is `jira auth refresh`'s envelope data. Today no auth type has a refresh flow, so refreshed is always false with the reason.
type AuthSwitchOutput ¶
type AuthSwitchOutput struct {
Active string `json:"active"`
Previous string `json:"previous"`
DryRun bool `json:"dry_run"`
}
AuthSwitchOutput is `auth switch`'s envelope data: the newly active profile and the one it replaced. dry_run is true on the preview that resolves the target without writing config.
type AuthTokenOutput ¶
type AuthTokenOutput struct {
Profile string `json:"profile"`
Source string `json:"source"`
Backend string `json:"backend"`
Valid bool `json:"valid"`
Redacted string `json:"redacted"`
Expiry *string `json:"expiry"`
Error string `json:"error"`
OnePasswordAccount string `json:"onepassword_account,omitempty"`
Vault string `json:"vault,omitempty"`
Item string `json:"item,omitempty"`
CredentialEnv string `json:"credential_env,omitempty"`
}
AuthTokenOutput is `jira auth token`'s envelope data — the redaction boundary: diagnostics only, never the credential. Expiry is a fixed null today (no supported auth type exposes one). The 1Password coordinates populate only for that backend; credential_env only for the env backend.
type AuthWhoamiOutput ¶
type AuthWhoamiOutput struct {
Profile string `json:"profile"`
AccountID string `json:"account_id"`
AccountType string `json:"account_type"`
DisplayName string `json:"display_name"`
EmailAddress string `json:"email_address"`
TimeZone string `json:"time_zone"`
Saved bool `json:"saved"`
}
AuthWhoamiOutput is `auth whoami`'s envelope data: the account identity /myself returned for the active profile. saved reports whether --save persisted the resolved account_id back to the file-backed profile.
type BoardRow ¶
type BoardRow struct {
ID int `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
ProjectKeys []string `json:"project_keys"`
}
BoardRow is one board's line in `boards list`: the flattened wire shape with pointer-typed fields collapsed to their zero values so agents need no null-handling for the common board case.
type BoardsListOutput ¶
type BoardsListOutput struct {
Boards []BoardRow `json:"boards"`
FromCache bool `json:"from_cache"`
FetchedAt string `json:"fetched_at"`
Truncated bool `json:"truncated"`
TruncatedReason string `json:"truncated_reason"`
CacheState string `json:"cache_state"`
CacheSourceState string `json:"cache_source_state"`
CacheEmpty bool `json:"cache_empty"`
}
BoardsListOutput is `boards list`'s envelope data: the boards plus the cache-state trio (cache_state / cache_source_state / cache_empty) and the from_cache/fetched_at/truncated markers every cache-backed read reports.
type CacheBoardsOutput ¶
type CacheBoardsOutput struct {
Profile string `json:"profile"`
Primed bool `json:"primed"`
FromCache bool `json:"from_cache"`
BoardsCount int `json:"boards_count"`
FetchedAt string `json:"fetched_at"`
TTLSeconds int `json:"ttl_seconds"`
Truncated bool `json:"truncated"`
TruncatedReason string `json:"truncated_reason"`
CacheState string `json:"cache_state"`
CacheSourceState string `json:"cache_source_state"`
CacheEmpty bool `json:"cache_empty"`
}
CacheBoardsOutput is `cache boards`'s envelope data on both the fresh-prime and cache-hit paths: the cached board count, freshness, and the truncation marker a partial prime carries, plus the shared cache-state trio. primed is true only when this invocation fetched from Jira and wrote the file.
type CacheClearOutput ¶
type CacheClearOutput struct {
Profile string `json:"profile"`
Resource string `json:"resource,omitempty"`
Removed any `json:"removed"`
DryRun bool `json:"dry_run"`
}
CacheClearOutput is `cache clear`'s envelope data. removed is an honest union the type system cannot narrow: an integer file count on a whole-cache clear, a boolean did-it-exist on a single-resource clear — declared via the register doc override. resource is present only when one resource was targeted.
type CacheIssueKeysOutput ¶
type CacheIssueKeysOutput struct {
Profile string `json:"profile"`
IssueKeys []string `json:"issue_keys"`
Count int `json:"count"`
}
CacheIssueKeysOutput is `cache issuekeys`'s envelope data: the active profile's recently used issue keys (newest first, never null) and their count. Local state, never fetched from Jira.
type CacheRefreshRow ¶
type CacheRefreshRow struct {
Status string `json:"status"`
FromCache bool `json:"from_cache"`
Count int `json:"count"`
FetchedAt string `json:"fetched_at"`
DurationMS int64 `json:"duration_ms"`
DryRun bool `json:"dry_run"`
}
CacheRefreshRow is one per-resource row inside `cache refresh`'s shared keyed-results envelope: the refresh outcome for a single cache resource. The op itself registers as Dynamic (the top-level keyed shape is owned by the shared cmdutil envelope), but the row is a fixed struct so the builder emits no map literal.
type ConfigGetOutput ¶
ConfigGetOutput is `config get`'s envelope data: the requested key and its value. Value is the config value in its native JSON type (string, integer, boolean, …), so it is an opaque `any` the schema leaves unconstrained.
type ConfigInitOutput ¶
type ConfigInitOutput struct {
Profile string `json:"profile"`
BaseURL string `json:"base_url"`
AuthType string `json:"auth_type"`
StoredAuth bool `json:"stored_auth"`
DryRun bool `json:"dry_run"`
}
ConfigInitOutput is `config init`'s envelope data: the bootstrapped profile and its metadata. stored_auth is always false — init writes metadata only, never a credential.
type ConfigProfileEntry ¶
ConfigProfileEntry is one row of `config profile`: a profile name and whether it is the active default.
type ConfigProfileOutput ¶
type ConfigProfileOutput struct {
ActiveProfile string `json:"active_profile"`
Profiles []ConfigProfileEntry `json:"profiles"`
}
ConfigProfileOutput is `config profile`'s envelope data: the active profile and the metadata-only list of configured profiles.
type ConfigSetOutput ¶
type ConfigSetOutput struct {
Key string `json:"key"`
Value string `json:"value"`
PreviousValue any `json:"previous_value"`
DryRun bool `json:"dry_run"`
}
ConfigSetOutput is `config set`'s envelope data: the key and new value, plus the value the change replaced (native JSON type, opaque). dry_run previews without writing.
type ConfigThemeOutput ¶
type ConfigThemeOutput struct {
Name string `json:"name"`
Path string `json:"path"`
Changed bool `json:"changed"`
DryRun bool `json:"dry_run"`
}
ConfigThemeOutput is `config theme`'s envelope data: the resolved theme name and path, whether the invocation changed anything, and the dry-run marker.
type Dynamic ¶
type Dynamic struct {
Reason string
}
Dynamic marks an operation whose data shape cannot be a fixed struct — a generated per-resource field name (the cache.<resource> family) or a registry dump emitted as a bare array. Registering one is a conscious, documented exception: the exhaustiveness guardrail counts it, and schema derivation leaves the op's hand-written schema untouched. Reason is mandatory and should say why a struct cannot express the shape.
type EpicAddOutput ¶
type EpicAddOutput struct {
Issue IssueRef `json:"issue"`
Epic string `json:"epic"`
DryRun bool `json:"dry_run"`
Added bool `json:"added"`
}
EpicAddOutput is `epic add`'s envelope data: the issue attached, the epic it was attached to, and the dry-run/added pair carried on both paths.
type EpicBoardOutput ¶
type EpicBoardOutput struct {
Epics []EpicBoardRow `json:"epics"`
Totals map[string]int `json:"totals"`
}
EpicBoardOutput is `epic board`'s envelope data: one row per epic plus the summed status totals across every epic.
type EpicBoardRow ¶
type EpicBoardRow struct {
Key string `json:"key"`
Summary string `json:"summary"`
Status string `json:"status"`
Counts map[string]int `json:"counts"`
}
EpicBoardRow is one epic's line in the `epic board` report: its identity and its child-issue counts by status.
type EpicListOutput ¶
type EpicListOutput struct {
JQL string `json:"jql"`
Epics []*jira.Issue `json:"epics"`
Detail bool `json:"detail"`
}
EpicListOutput is `epic list`'s envelope data: the standard epic JQL echoed back with the epics it returned. The no-profile degraded path returns the JQL with an empty epics list so agents can still see the intended query.
type EpicRemoveOutput ¶
type EpicRemoveOutput struct {
Issue IssueRef `json:"issue"`
DryRun bool `json:"dry_run"`
Removed bool `json:"removed"`
}
EpicRemoveOutput is `epic remove`'s envelope data: the issue detached from its epic, with the dry-run/removed pair carried on both paths.
type IssueAttachmentAddOutput ¶
type IssueAttachmentAddOutput struct {
Issue IssueRef `json:"issue"`
Files []map[string]any `json:"files,omitempty"`
Attachments []map[string]any `json:"attachments,omitempty"`
DryRun bool `json:"dry_run"`
}
IssueAttachmentAddOutput is `issue attachment add`'s data. The dry-run preview lists the inferred `files`; the live upload lists the created `attachments`. Exactly one is present per path.
type IssueAttachmentDeleteOutput ¶
type IssueAttachmentDeleteOutput struct {
Issue IssueRef `json:"issue"`
AttachmentID string `json:"attachment_id"`
Deleted bool `json:"deleted,omitempty"`
DryRun bool `json:"dry_run"`
}
IssueAttachmentDeleteOutput is `issue attachment delete`'s data. `deleted` rides the live path only.
type IssueAttachmentDownloadOutput ¶
type IssueAttachmentDownloadOutput struct {
Issue IssueRef `json:"issue"`
AttachmentID string `json:"attachment_id"`
Mode string `json:"mode"`
Target *string `json:"target,omitempty"`
WrittenTo string `json:"written_to,omitempty"`
Bytes *int64 `json:"bytes,omitempty"`
DryRun bool `json:"dry_run"`
}
IssueAttachmentDownloadOutput is `issue attachment download`'s data. The dry-run preview reports the planned write `target` (present even when empty in current-dir mode, so a pointer); the live path reports `written_to` and the `bytes` written (a pointer so a zero-byte file still emits the count). `mode` rides both paths.
type IssueAttachmentListOutput ¶
type IssueAttachmentListOutput struct {
Attachments []map[string]any `json:"attachments"`
Pagination *Pagination `json:"pagination,omitempty"`
}
IssueAttachmentListOutput is `issue attachment list`'s data. Single-key reads carry only `attachments` (pagination in meta); multi-key reads fold the per-key pagination block in. Each attachment is projected to a fixed snake-case shape but kept as an opaque object here.
type IssueCommentAddOutput ¶
type IssueCommentAddOutput struct {
Issue IssueRef `json:"issue"`
Comment map[string]any `json:"comment"`
DryRun bool `json:"dry_run"`
Warnings []adf.Warning `json:"warnings,omitempty"`
}
IssueCommentAddOutput is `issue comment add`'s data (and the group alias `issue comment`). `comment` is the created comment on the live path and a {body: <ADF>} preview on dry-run, so it stays an opaque object. `warnings` appears only on multi-key writes, where command-wide markdown/ADF warnings travel with each per-key result.
type IssueCommentDeleteOutput ¶
type IssueCommentDeleteOutput struct {
Issue IssueRef `json:"issue"`
CommentID string `json:"comment_id"`
Deleted bool `json:"deleted,omitempty"`
DryRun bool `json:"dry_run"`
}
IssueCommentDeleteOutput is `issue comment delete`'s data. `deleted` rides only the live path (always true there); the dry-run preview omits it.
type IssueCommentEditOutput ¶
type IssueCommentEditOutput struct {
Issue IssueRef `json:"issue"`
CommentID string `json:"comment_id,omitempty"`
// BodyADFSummary carries the validated *adf.Document on the dry-run path.
// It is typed `any` (not *adf.Document) because ADF nodes nest
// recursively and the schema deriver walks types without a cycle guard;
// the object type is restored through the registration override below.
BodyADFSummary any `json:"body_adf_summary,omitempty"`
VisibilityChange string `json:"visibility_change,omitempty"`
Comment map[string]any `json:"comment,omitempty"`
DryRun bool `json:"dry_run"`
}
IssueCommentEditOutput is `issue comment edit`'s data. The dry-run preview carries the validated body summary and the visibility change; the live write echoes the updated comment instead. `comment_id` is present only on the preview (the live path identifies the comment via the echoed body).
type IssueCommentListOutput ¶
type IssueCommentListOutput struct {
Comments []map[string]any `json:"comments"`
Pagination *Pagination `json:"pagination,omitempty"`
Warnings []map[string]any `json:"warnings,omitempty"`
}
IssueCommentListOutput is `issue comment list`'s data. Single-key reads carry only `comments` (pagination rides in meta); multi-key reads fold the per-key pagination block and any lossy-ADF / rate-limit warnings into the same object at results[].data. Comment bodies stay native ADF, so each entry is an opaque object rather than a fixed struct.
type IssueCreateOutput ¶
type IssueCreateOutput struct {
Issue *jira.Issue `json:"issue,omitempty"`
Preview map[string]any `json:"preview,omitempty"`
DryRun bool `json:"dry_run"`
ValidatedRemotely bool `json:"validated_remotely,omitempty"`
// Verification is the optional --verify re-fetch diff (issue.verificationResult).
Verification any `json:"verification,omitempty"`
}
IssueCreateOutput is `issue create`'s envelope data across the dry-run preview and the live write. dry_run rides both paths; issue is the created issue on a live write, preview the would-be payload on a dry-run.
type IssueDestructiveOutput ¶
type IssueDestructiveOutput struct {
Issue IssueRef `json:"issue"`
Result *jira.Issue `json:"result,omitempty"`
Payload map[string]any `json:"payload,omitempty"`
DryRun bool `json:"dry_run"`
Warnings []adf.Warning `json:"warnings,omitempty"`
}
IssueDestructiveOutput is the shared envelope data for the clone, move, and delete mutations. payload previews the validated fields on a dry-run; result is the resulting issue on a live clone/move (delete carries none). warnings travels inside each key's data on a fan-out run.
type IssueEditOutput ¶
type IssueEditOutput struct {
Issue IssueRef `json:"issue"`
Result *jira.Issue `json:"result,omitempty"`
DryRun bool `json:"dry_run"`
Fields map[string]any `json:"fields"`
Update map[string]any `json:"update,omitempty"`
ValidatedRemotely bool `json:"validated_remotely,omitempty"`
Verification any `json:"verification,omitempty"`
Warnings []adf.Warning `json:"warnings,omitempty"`
}
IssueEditOutput is `issue edit`'s envelope data. issue, dry_run, and the validated fields echo ride every path; result is the updated issue on a live write. update carries a native REST operation block verbatim; warnings travels inside each key's data on a fan-out edit.
type IssueLinkCreateOutput ¶
type IssueLinkCreateOutput struct {
InwardIssue IssueRef `json:"inward_issue"`
OutwardIssue IssueRef `json:"outward_issue"`
Type string `json:"type"`
TypeID string `json:"type_id,omitempty"`
Comment map[string]any `json:"comment,omitempty"`
DryRun bool `json:"dry_run"`
}
IssueLinkCreateOutput is `issue link`'s create data. `type` is always present (empty when the native body addressed the type by id only); `type_id` and `comment` appear only when the native body supplied them.
type IssueLinkDeleteOutput ¶
type IssueLinkDeleteOutput struct {
Issue IssueRef `json:"issue"`
LinkID string `json:"link_id"`
Deleted bool `json:"deleted,omitempty"`
DryRun bool `json:"dry_run"`
}
IssueLinkDeleteOutput is `issue link delete`'s data. `link_id` echoes the supplied id verbatim (links are global); `deleted` rides the live path only.
type IssueLinkListOutput ¶
type IssueLinkListOutput struct {
Issue IssueRef `json:"issue"`
Links []jira.IssueLinkView `json:"links"`
Count int `json:"count"`
}
IssueLinkListOutput is `issue link list`'s data: Jira's inward/outward fork flattened into one direction-aware array. Multi-key reads carry the same object at results[].data.
type IssueLinkTypesOutput ¶
type IssueLinkTypesOutput struct {
LinkTypes []jira.IssueLinkType `json:"link_types"`
Count int `json:"count"`
FromCache bool `json:"from_cache"`
FetchedAt string `json:"fetched_at"`
CacheState string `json:"cache_state"`
CacheSourceState string `json:"cache_source_state"`
CacheEmpty bool `json:"cache_empty"`
}
IssueLinkTypesOutput is `issue link types`'s data: the configured link types plus the cache-provenance trio every cache-backed read carries.
type IssueListAssignee ¶
type IssueListAssignee struct {
AccountID string `json:"account_id,omitempty"`
DisplayName string `json:"display_name,omitempty"`
}
IssueListAssignee is the trimmed user identity a projected issue row carries.
type IssueListOutput ¶
type IssueListOutput struct {
// Issues is the default projected row list; --detail swaps in full
// issues, and --count omits it. The schema describes the default
// projection (IssueListRow). The builder emits a map so the bespoke
// human/compact renderers keep their map contract until the renderer
// integration lands; this struct is the schema template.
Issues []IssueListRow `json:"issues,omitempty"`
// Detail echoes --detail; absent on --count. A pointer so an explicit
// false is still emitted where the field applies.
Detail *bool `json:"detail,omitempty"`
// Jql is the resolved query; present on every variant.
Jql string `json:"jql"`
// Precedence and BoardScope report board scoping; absent on --count.
Precedence string `json:"precedence,omitempty"`
BoardScope map[string]any `json:"board_scope,omitempty"`
// Count is present only on the --count variant (issue.list.count).
Count *int `json:"count,omitempty"`
// URL is present only on the --as-jql variant (issue.list.jql).
URL string `json:"url,omitempty"`
// SucceededKeyChunks / FailedKeyChunks appear only when a chunked --key
// listing partially fails.
SucceededKeyChunks *int `json:"succeeded_key_chunks,omitempty"`
FailedKeyChunks any `json:"failed_key_chunks,omitempty"`
}
IssueListOutput is the union `issue list` emits across its variants: the paged/keyed listing (issue.list), the estimate (issue.list.count), and the JQL preview (issue.list.jql). One cobra path feeds all three, so a single struct covers the union with the variant-only fields omitempty; jql is the one field every variant carries. board_scope and the key-chunk echoes stay opaque — they are caller/Jira data, not contract surface the type expresses.
type IssueListRow ¶
type IssueListRow struct {
Key string `json:"key"`
Summary string `json:"summary"`
Status string `json:"status"`
StatusCategory string `json:"status_category"`
StatusColor string `json:"status_color,omitempty"`
Assignee *IssueListAssignee `json:"assignee,omitempty"`
Priority *string `json:"priority,omitempty"`
Updated string `json:"updated"`
}
IssueListRow is the projected issue row `issue list` emits by default (cmdutil.IssueOutput). assignee and priority are nullable per spec but not required; the pointer-omitempty derivation makes them optional, and issueListDoc refines them to also accept null.
type IssueRankOutput ¶
type IssueRankOutput struct {
Anchor string `json:"anchor"`
Position string `json:"position"`
Order []string `json:"order"`
Chunks int `json:"chunks"`
DryRun bool `json:"dry_run"`
// Ranked is present (false) only on the no-profile degraded path, where
// the command validates and reports without a client to submit through.
Ranked *bool `json:"ranked,omitempty"`
}
IssueRankOutput is `issue rank`'s envelope data: the requested ordering echoed back with the chunking the transport applied.
type IssueRef ¶
type IssueRef struct {
ID string `json:"id,omitempty"`
Key string `json:"key"`
Self string `json:"self,omitempty"`
}
IssueRef is the envelope contract's issue identity: every issue-scoped envelope carries `data.issue` as an object with at least `key`, never a bare string, so `.data.issue.key` reads identically across create, edit, view, transition, comment, worklog, and epic envelopes. Richer payloads (create's POST response, view's full issue) satisfy the same minimum by carrying key at the same place. Introduced in contract v2 — v1 let mutation envelopes ship the key as a bare string, which made `.data.issue` change type between commands.
type IssueTransitionOutput ¶
type IssueTransitionOutput struct {
Issue IssueRef `json:"issue"`
Transition string `json:"transition,omitempty"`
DryRun bool `json:"dry_run"`
Fields map[string]any `json:"fields,omitempty"`
Comment any `json:"comment,omitempty"`
Update map[string]any `json:"update,omitempty"`
TransitionValidated bool `json:"transition_validated,omitempty"`
Warnings []adf.Warning `json:"warnings,omitempty"`
}
IssueTransitionOutput is `issue transition`'s envelope data when a target is applied (or previewed). transition is the resolved id (or the requested target on a bare dry-run); the payload sections and transition_validated appear only on the dry-run preview paths.
type IssueTransitionsOutput ¶
type IssueTransitionsOutput struct {
Issue IssueRef `json:"issue"`
Transitions []*jira.Transition `json:"transitions"`
}
IssueTransitionsOutput is the no-target `issue transition` read: the issue and its available workflow transitions.
type IssueViewOutput ¶
type IssueViewOutput struct {
// Issue is the single-key payload; the multi-key and --web variants
// carry the doc-declared fields below instead, so it is optional in
// the published union (always present on a single-key read).
Issue *jira.Issue `json:"issue,omitempty"`
}
IssueViewOutput is single-key `issue view`'s envelope data. The multi-key form carries an ordered results set instead (a keyed exception the schema documents as prose), so only the single-key shape is a fixed struct.
type IssueWatcherMutationOutput ¶
type IssueWatcherMutationOutput struct {
Issue IssueRef `json:"issue"`
User string `json:"user,omitempty"`
UserResolved *bool `json:"user_resolved,omitempty"`
AccountIDResolved string `json:"account_id_resolved,omitempty"`
AccountID string `json:"account_id,omitempty"`
Attempted bool `json:"attempted,omitempty"`
Watchers *[]map[string]any `json:"watchers,omitempty"`
IsWatching *bool `json:"is_watching,omitempty"`
WatchCount *int `json:"watch_count,omitempty"`
WasAlreadyWatching *bool `json:"was_already_watching,omitempty"`
DryRun bool `json:"dry_run"`
}
IssueWatcherMutationOutput is the data for `issue watchers add` and `issue watchers remove` (and the watch/unwatch shortcuts) — one shape, so consumers never branch on which verb ran. Three code paths emit disjoint key sets, and the pointer fields keep a false/zero/empty value present on the path that carries it while staying absent on the others:
- dry-run: issue, user, dry_run, user_resolved, account_id_resolved?
- no-readback: issue, account_id, attempted, dry_run
- readback: issue, watchers, is_watching, watch_count, was_already_watching, dry_run
type IssueWatchersListOutput ¶
type IssueWatchersListOutput struct {
Watchers []map[string]any `json:"watchers"`
IsWatching bool `json:"is_watching"`
WatchCount int `json:"watch_count"`
}
IssueWatchersListOutput is `issue watchers list`'s data. Multi-key reads carry the same object at results[].data.
type IssueWebLinkOutput ¶
type IssueWebLinkOutput struct {
Issue IssueRef `json:"issue"`
URL string `json:"url"`
Title string `json:"title"`
DryRun bool `json:"dry_run"`
URLRemoteChecked *bool `json:"url_remote_checked,omitempty"`
}
IssueWebLinkOutput is `issue weblink`'s data. `url_remote_checked` is emitted (always false) only on the dry-run path, to state plainly that the preview validated URL syntax locally and never fetched the target — a pointer so its presence, not its value, marks the preview.
type JQLBuildOutput ¶
type JQLBuildOutput struct {
JQL string `json:"jql"`
URL string `json:"url"`
Precedence string `json:"precedence"`
BoardScope map[string]any `json:"board_scope"`
}
JQLBuildOutput is `jql build`'s envelope data: the composed query, a best-effort deep link, the board-scope precedence, and the board-scope block. BoardScope is a variable-key map (applied plus, when resolved, id / name / type / project_keys), so it stays a map.
type JQLReferenceField ¶
type JQLReferenceField struct {
Value string `json:"value"`
DisplayName string `json:"display_name"`
CustomFieldID string `json:"custom_field_id,omitempty"`
}
JQLReferenceField is one queryable field in `jql reference`: its JQL value, display name, and custom-field id when it is a custom field.
type JQLReferenceFunction ¶
type JQLReferenceFunction struct {
Value string `json:"value"`
DisplayName string `json:"display_name"`
}
JQLReferenceFunction is one JQL function in `jql reference`.
type JQLReferenceOutput ¶
type JQLReferenceOutput struct {
Fields []JQLReferenceField `json:"fields"`
Functions []JQLReferenceFunction `json:"functions"`
ReservedWords []string `json:"reserved_words"`
}
JQLReferenceOutput is `jql reference`'s envelope data: the site's queryable fields, functions, and reserved words from /jql/autocompletedata.
type JQLValidateEntry ¶
type JQLValidateEntry struct {
Query string `json:"query"`
Valid bool `json:"valid"`
Errors []string `json:"errors,omitempty"`
Warnings []string `json:"warnings,omitempty"`
}
JQLValidateEntry is one query's result from `jql validate`: the query, its validity, and Jira's errors/warnings when present. A parse failure is a result (valid: false), not a command error.
type JQLValidateOutput ¶
type JQLValidateOutput struct {
Queries []JQLValidateEntry `json:"queries"`
}
JQLValidateOutput is `jql validate`'s envelope data: one entry per query.
type MeOutput ¶
type MeOutput struct {
Profile string `json:"profile"`
AccountID string `json:"account_id"`
DisplayName string `json:"display_name"`
EmailAddress string `json:"email_address"`
TimeZone string `json:"time_zone"`
}
MeOutput is `me`'s envelope data: the active profile name and the resolved Jira account identity from /myself.
type Pagination ¶
type Pagination struct {
StartAt int `json:"startAt"` //nolint:revive // pagination-exempt
MaxResults int `json:"maxResults"`
Total *int `json:"total,omitempty"`
IsLast bool `json:"isLast"`
NextCursor string `json:"nextCursor,omitempty"`
}
Pagination is the canonical pagination block, identical on every paginated command: meta.pagination on single-target reads, and the same shape inside keyed multi-key results[].data. It lives in this leaf package so typed Output structs can carry it without importing the renderer layer; internal/cli aliases it for its many existing call sites.
type SearchCountOutput ¶
type SearchCountOutput struct {
Source string `json:"source"`
JQL string `json:"jql"`
Count int `json:"count"`
}
SearchCountOutput is `search jql --count`'s envelope data: Jira's approximate match count for the query, with no issues fetched.
type SearchJQLOutput ¶
type SearchJQLOutput struct {
Source string `json:"source"`
JQL string `json:"jql"`
Issues any `json:"issues,omitempty"`
URL string `json:"url,omitempty"`
Opened bool `json:"opened,omitempty"`
}
SearchJQLOutput is `search jql`'s envelope data. Issues is polymorphic by path: the compact per-issue projection by default, Jira's raw records under --full, and absent on the --web preview (which carries url/opened instead of running the query). Issues holds any so the field selector can never change the field's static type.
type SearchSavedOutput ¶
type SearchSavedOutput struct {
Source string `json:"source"`
Key string `json:"key"`
Name string `json:"name"`
Description string `json:"description"`
Project string `json:"project"`
JQL string `json:"jql"`
Issues any `json:"issues"`
}
SearchSavedOutput is `search saved`'s envelope data: the named query's metadata (from the queries file) and the issues it returned. Issues holds the same compact-or-raw projection as search jql, hence any.
type UpdateOutput ¶
type UpdateOutput struct {
Channel string `json:"channel"`
Current string `json:"current"`
Latest string `json:"latest,omitempty"`
UpdateAvailable *bool `json:"update_available,omitempty"`
Managed bool `json:"managed"`
Hint string `json:"hint,omitempty"`
Updated bool `json:"updated"`
DryRun bool `json:"dry_run"`
}
UpdateOutput is `update`'s envelope data, a union over the two install shapes discriminated by managed. A self-replacing channel (managed=false) reports latest and update_available; a managed channel (managed=true) reports the installer's update hint instead, and omits both. updated is true only after a live self-replace committed.
type UserSearchMatch ¶
type UserSearchMatch struct {
AccountID string `json:"account_id"`
DisplayName string `json:"display_name"`
EmailAddress string `json:"email_address"`
}
UserSearchMatch is one account in `user search` results: the account_id an ADF mention needs, plus the fields a caller disambiguates on.
type UserSearchOutput ¶
type UserSearchOutput struct {
Query string `json:"query"`
Users []UserSearchMatch `json:"users"`
Count int `json:"count"`
}
UserSearchOutput is `user search`'s envelope data: the query echoed back with the active, non-deleted account matches and their count.
type VersionOutput ¶
type VersionOutput struct {
Version string `json:"version"`
Commit string `json:"commit"`
Branch string `json:"branch"`
BuildTime string `json:"build_time"`
BuildBy string `json:"build_by"`
Summary string `json:"summary"`
}
VersionOutput is `jira version`'s envelope data: the build metadata the ldflags inject.
type WebOpenIssueOutput ¶
type WebOpenIssueOutput struct {
Issue IssueRef `json:"issue"`
}
WebOpenIssueOutput is the data payload of a --web browser open scoped to one issue (issue view --web, jira open): the identity of what was opened; the URL rides in the web envelope itself.
type WebOpenSearchOutput ¶
WebOpenSearchOutput is the data payload of a --web browser open for a JQL search: the query that was opened.
type WorklogAddOutput ¶
type WorklogAddOutput struct {
Issue IssueRef `json:"issue"`
Worklog any `json:"worklog"`
DryRun bool `json:"dry_run"`
// Warnings carries the command-wide ADF warnings on batch entries only:
// a multi-key add has no single envelope warnings[] home per resource,
// so each per-key result carries its own copy. Single-key adds leave it
// empty and use the envelope's warnings[].
Warnings []adf.Warning `json:"warnings,omitempty"`
}
WorklogAddOutput is `worklog add`'s envelope data. Worklog holds two shapes by path: a *jira.Worklog on the live add (Jira's native worklog, with its server id) and a *WorklogDraft under --dry-run (the parsed submission, no id). One any field carries both because the shapes genuinely differ — the live record is omitempty-sparse, the draft is always-present — so neither can stand in for the other without changing emitted bytes. The doc override on registration restores the object sub-schema the any erases.
type WorklogDraft ¶
type WorklogDraft struct {
TimeSpentSeconds int `json:"timeSpentSeconds"`
Started string `json:"started"`
Comment *adf.Document `json:"comment"`
}
WorklogDraft is the parsed-but-unsubmitted worklog `worklog add --dry-run` echoes back: the values that would be sent to Jira, with no server-assigned id. The live add carries a *jira.Worklog in the same place instead, so the carrier field (WorklogAddOutput.Worklog) is typed any.
type WorklogListOutput ¶
type WorklogListOutput struct {
Issue IssueRef `json:"issue"`
Worklogs []*jira.Worklog `json:"worklogs"`
}
WorklogListOutput is `worklog list`'s per-issue envelope data: the issue and its worklogs in Jira's native shape. Multi-key reads carry the same object at results[].data.