Documentation
¶
Overview ¶
Package envelope owns each operation's extensible data object and derives its published JSON Schema from the same registered Output type. Fixed members and nested identities are concrete structs; tenant-defined Jira fields, recursive ADF and reviewed polymorphic values form the dynamic boundary. Truly shapeless operations register Dynamic with a reason. It sits below internal/cli in the import graph: wire-type imports (internal/jira, internal/adf) are allowed, but internal/cli is not. The top-level failure envelope and local-output taxonomy remain owned by internal/cli and internal/errtax.
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 AgentADFMatrixOutput
- type AgentFieldTypesOutput
- type AliasDeleteOutput
- type AliasImportOutput
- type AliasListOutput
- type AliasSetOutput
- type AttachmentAuthor
- type AttachmentFile
- type AttachmentItem
- 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 CommentItem
- type CommentUser
- 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 IssueFieldsPayload
- type IssueLinkCreateOutput
- type IssueLinkDeleteOutput
- type IssueLinkListOutput
- type IssueLinkPreview
- 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 OpenSchema
- type Pagination
- type SearchCountOutput
- type SearchJQLOutput
- type SearchSavedOutput
- type UpdateOutput
- type UserSearchMatch
- type UserSearchOutput
- type VersionOutput
- type WatcherItem
- 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 AgentADFMatrixOutput ¶ added in v0.15.2
AgentADFMatrixOutput preserves the established top-level array while keeping its row schema derivable from adf.Entry.
type AgentFieldTypesOutput ¶ added in v0.15.2
type AgentFieldTypesOutput []customfield.Entry
AgentFieldTypesOutput preserves the established top-level array while keeping its row schema derivable from customfield.Entry.
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 AttachmentAuthor ¶ added in v0.15.2
type AttachmentAuthor struct {
AccountID string `json:"account_id"`
DisplayName string `json:"display_name"`
}
AttachmentAuthor is the fixed uploader identity projected on attachments.
type AttachmentFile ¶ added in v0.15.2
type AttachmentFile struct {
MIMEInferred string `json:"mime_inferred"`
Path string `json:"path"`
Size int64 `json:"size"`
}
AttachmentFile is the locally validated file metadata retained by both attachment-add paths.
type AttachmentItem ¶ added in v0.15.2
type AttachmentItem struct {
Author AttachmentAuthor `json:"author"`
Created string `json:"created"`
Filename string `json:"filename"`
ID string `json:"id"`
MIMEType string `json:"mime_type"`
Size int64 `json:"size"`
}
AttachmentItem is the fixed attachment projection returned by list and add.
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 CommentItem ¶ added in v0.15.2
type CommentItem struct {
Author *CommentUser `json:"author"`
Body any `json:"body"`
Created string `json:"created,omitempty"`
ID string `json:"id,omitempty"`
UpdateAuthor *CommentUser `json:"update_author"`
Updated string `json:"updated,omitempty"`
Visibility *jira.Visibility `json:"visibility"`
}
CommentItem is the fixed comment projection returned by comment list and live comment edit. Body stays dynamic because Jira returns recursive ADF.
type CommentUser ¶ added in v0.15.2
type CommentUser struct {
AccountID string `json:"account_id,omitempty"`
DisplayName string `json:"display_name,omitempty"`
EmailAddress string `json:"email_address,omitempty"`
}
CommentUser is the projected identity carried by a comment author.
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 []AttachmentFile `json:"files"`
Attachments []AttachmentItem `json:"attachments,omitempty"`
DryRun bool `json:"dry_run"`
}
IssueAttachmentAddOutput is `issue attachment add`'s data. files carries the validated upload context on both paths; attachments is the live outcome.
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"`
WrittenTo string `json:"written_to,omitempty"`
Bytes *int64 `json:"bytes,omitempty"`
DryRun bool `json:"dry_run"`
}
IssueAttachmentDownloadOutput is `issue attachment download`'s data. target retains the originally requested destination on both paths; written_to and bytes report the live outcome. A zero-byte file still emits bytes via the pointer.
type IssueAttachmentListOutput ¶
type IssueAttachmentListOutput struct {
Issue IssueRef `json:"issue"`
Attachments []AttachmentItem `json:"attachments"`
Pagination *Pagination `json:"pagination,omitempty"`
}
IssueAttachmentListOutput is `issue attachment list`'s data. The issue and attachments ride both single-key and keyed reads. Single-key pagination rides in meta; keyed reads fold the per-key pagination block into data.
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"`
// BodyADFSummary carries the validated *adf.Document on both paths.
// 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"`
VisibilityChange string `json:"visibility_change"`
Comment *CommentItem `json:"comment,omitempty"`
DryRun bool `json:"dry_run"`
}
IssueCommentEditOutput is `issue comment edit`'s data. The validated body summary, comment identity, and visibility change ride both paths; the live write also carries the updated comment returned by Jira.
type IssueCommentListOutput ¶
type IssueCommentListOutput struct {
Issue IssueRef `json:"issue"`
Comments []CommentItem `json:"comments"`
Pagination *Pagination `json:"pagination,omitempty"`
Warnings []map[string]any `json:"warnings,omitempty"`
}
IssueCommentListOutput is `issue comment list`'s data. The issue and comments ride both single-key and keyed reads. Single-key pagination rides in meta; keyed reads fold the per-key pagination block and any lossy-ADF or rate-limit warnings into the same object at results[].data.
type IssueCreateOutput ¶
type IssueCreateOutput struct {
Issue *jira.Issue `json:"issue,omitempty"`
Preview map[string]any `json:"preview"`
DryRun bool `json:"dry_run"`
ValidatedRemotely bool `json:"validated_remotely"`
// 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. The validated preview and validation provenance ride both paths; issue is the created issue on a live write.
type IssueDestructiveOutput ¶
type IssueDestructiveOutput struct {
Issue IssueRef `json:"issue"`
Result *jira.Issue `json:"result,omitempty"`
Payload IssueFieldsPayload `json:"payload"`
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 carries the validated fields on both paths; 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"`
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 IssueFieldsPayload ¶ added in v0.15.2
IssueFieldsPayload is the fixed payload shared by clone, move, and delete. Fields is empty but present for mutations that submit no field changes.
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"`
Preview *IssueLinkPreview `json:"preview,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. `preview` renders the sentence each endpoint's page will display and appears when the link type's phrase pair is known — always on a live create (a cache miss triggers one /issueLinkType fetch), and from the per-profile linktypes cache on `--dry-run`, which stays offline.
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 IssueLinkPreview ¶ added in v0.15.2
type IssueLinkPreview struct {
InwardIssueSentence string `json:"inward_issue_sentence"`
OutwardIssueSentence string `json:"outward_issue_sentence"`
}
IssueLinkPreview names the sentence each issue's own page will render once the link exists. The field names anchor to the ISSUE, not the phrase: the inward issue displays the type's outward phrase and vice versa, which is exactly the crossover the preview exists to make visible before creating.
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"`
Created string `json:"created"`
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"`
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); supplied payload sections ride both 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"`
UserResolved bool `json:"user_resolved"`
AccountIDResolved string `json:"account_id_resolved,omitempty"`
AccountID string `json:"account_id,omitempty"`
Attempted bool `json:"attempted,omitempty"`
Watchers *[]WatcherItem `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. User and resolution context ride every path; the remaining pointer fields keep a false/zero/empty outcome 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: stable context plus account_id, attempted
- readback: stable context plus watchers, is_watching, watch_count, was_already_watching, dry_run
type IssueWatchersListOutput ¶
type IssueWatchersListOutput struct {
Issue IssueRef `json:"issue"`
Watchers []WatcherItem `json:"watchers"`
IsWatching bool `json:"is_watching"`
WatchCount int `json:"watch_count"`
}
IssueWatchersListOutput is `issue watchers list`'s data. Single-key and keyed reads carry the same issue-scoped object.
type IssueWebLinkOutput ¶
type IssueWebLinkOutput struct {
Issue IssueRef `json:"issue"`
URL string `json:"url"`
Title string `json:"title"`
URLRemoteChecked bool `json:"url_remote_checked"`
DryRun bool `json:"dry_run"`
}
IssueWebLinkOutput is `issue weblink`'s data. url_remote_checked is always false because both paths validate URL syntax locally without fetching the target.
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 OpenSchema ¶ added in v0.15.2
type OpenSchema interface {
OpenSchemaProperties() string
}
OpenSchema marks a wire type whose JSON object legitimately carries keys beyond its named members (a reviewed dynamic boundary, e.g. Jira's tenant-defined fields block). SchemaOf publishes such a type with `additionalProperties: true`, and the conformance guardrail accepts undeclared keys inside it instead of reporting drift.
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 WatcherItem ¶ added in v0.15.2
type WatcherItem struct {
AccountID string `json:"account_id"`
DisplayName string `json:"display_name"`
EmailAddress *string `json:"email_address,omitempty"`
}
WatcherItem is the fixed user projection returned by watcher reads.
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.