appstore

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MissingLocalizationResources

func MissingLocalizationResources(remote Metadata, locales []string) []string

func PrivateKeyPermissionWarning

func PrivateKeyPermissionWarning(keyPath string) string

func ValidatePlan added in v1.1.4

func ValidatePlan(remote Metadata, locales []string, changes []Change) error

ValidatePlan checks every locally-detectable App Store Connect constraint before ApplyMetadata performs its first mutation. It is also used by CLI dry-runs, so a successful dry-run is a meaningful execution preflight.

Types

type AccessibilityDeclaration added in v1.1.0

type AccessibilityDeclaration struct {
	ID     string
	State  string
	Values map[string]string
}

type AppStoreReleasePlan added in v1.2.0

type AppStoreReleasePlan struct {
	Kind                string             `json:"kind"`
	AppID               string             `json:"app_id"`
	BundleID            string             `json:"bundle_id"`
	Platform            string             `json:"platform"`
	Version             string             `json:"version"`
	Build               string             `json:"build,omitempty"`
	ReleaseType         string             `json:"release_type,omitempty"`
	EarliestReleaseDate string             `json:"earliest_release_date,omitempty"`
	Operations          []ReleaseOperation `json:"operations"`
	// contains filtered or unexported fields
}

AppStoreReleasePlan is the preflight result shared by --dry-run and the execution path. The unexported IDs are resolved from App Store Connect and prevent execution from acting on a different app or build than the plan.

type AppStoreStatus added in v1.2.0

type AppStoreStatus struct {
	AppID               string                  `json:"app_id"`
	VersionID           string                  `json:"version_id"`
	Platform            string                  `json:"platform"`
	Version             string                  `json:"version"`
	AppVersionState     string                  `json:"app_version_state,omitempty"`
	AppStoreState       string                  `json:"app_store_state,omitempty"`
	ReleaseType         string                  `json:"release_type,omitempty"`
	EarliestReleaseDate string                  `json:"earliest_release_date,omitempty"`
	Build               *BuildStatus            `json:"build,omitempty"`
	ReviewSubmission    *ReviewSubmissionStatus `json:"review_submission,omitempty"`
}

AppStoreStatus is the current App Store release state for one configured platform and version.

type Asset added in v1.1.0

type Asset struct {
	ID                   string
	FileName             string
	Path                 string
	Checksum             string
	Size                 int64
	Content              []byte
	MIMEType             string
	PreviewFrameTimeCode string
}

type AssetSetChange added in v1.1.0

type AssetSetChange struct {
	Kind           string
	Locale         string
	DisplayType    string
	LocalizationID string
	SetID          string
	Before         []Asset
	After          []Asset
}

type BuildStatus added in v1.2.0

type BuildStatus struct {
	ID              string `json:"id"`
	Version         string `json:"version"`
	UploadedDate    string `json:"uploaded_date,omitempty"`
	ExpirationDate  string `json:"expiration_date,omitempty"`
	ProcessingState string `json:"processing_state,omitempty"`
	AudienceType    string `json:"audience_type,omitempty"`
	Expired         bool   `json:"expired"`
}

BuildStatus is the release-oriented view of an App Store Connect build. It deliberately contains no analytics or tester data.

type Change

type Change struct {
	Locale       string
	DeviceFamily string
	Field        string
	Before       string
	After        string
	AssetSet     *AssetSetChange
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(credentials Credentials, baseURL string, options ...Option) *Client

func (*Client) ApplyAppStoreRelease added in v1.2.0

func (c *Client) ApplyAppStoreRelease(ctx context.Context, plan AppStoreReleasePlan) error

func (*Client) ApplyAppStoreSubmission added in v1.2.0

func (c *Client) ApplyAppStoreSubmission(ctx context.Context, plan AppStoreReleasePlan) error

ApplyAppStoreSubmission executes a previously validated plan. Callers must obtain explicit user confirmation before invoking this method.

func (*Client) ApplyMetadata

func (c *Client) ApplyMetadata(ctx context.Context, remote Metadata, locales []string, changes []Change) error

func (*Client) ApplyTestFlightDistribution added in v1.2.0

func (c *Client) ApplyTestFlightDistribution(ctx context.Context, plan TestFlightDistributionPlan) error

func (*Client) CheckAuth

func (c *Client) CheckAuth(ctx context.Context) error

func (*Client) FetchAppStoreStatus added in v1.2.0

func (c *Client) FetchAppStoreStatus(ctx context.Context, appID, bundleID, platform, version string) (AppStoreStatus, error)

func (*Client) FetchMetadata

func (c *Client) FetchMetadata(ctx context.Context, appID, bundleID, platform, version string, options FetchOptions) (Metadata, error)

func (*Client) FetchTestFlightStatus added in v1.2.0

func (c *Client) FetchTestFlightStatus(ctx context.Context, appID, bundleID, platform, version string) (TestFlightStatus, error)

func (*Client) ListPricePoints added in v1.1.0

func (c *Client) ListPricePoints(ctx context.Context, appID, territory string) ([]PricePoint, error)

func (*Client) PlanAppStoreRelease added in v1.2.0

func (c *Client) PlanAppStoreRelease(ctx context.Context, appID, bundleID, platform, version string) (AppStoreReleasePlan, error)

func (*Client) PlanAppStoreSubmission added in v1.2.0

func (c *Client) PlanAppStoreSubmission(ctx context.Context, appID, bundleID, platform, version string, options SubmitOptions) (AppStoreReleasePlan, error)

PlanAppStoreSubmission performs every read and validation needed before an App Store submission. It never mutates App Store Connect.

func (*Client) PlanTestFlightDistribution added in v1.2.0

func (c *Client) PlanTestFlightDistribution(ctx context.Context, appID, bundleID, platform, version string, options TestFlightDistributionOptions) (TestFlightDistributionPlan, error)

func (*Client) ResolveAppID added in v1.1.4

func (c *Client) ResolveAppID(ctx context.Context, appID, bundleID string) (string, error)

ResolveAppID resolves and validates the app identity without fetching a version. Commands such as price-points can therefore support bundle-ID-only configurations consistently with pull and push.

type Credentials

type Credentials struct {
	IssuerID string
	KeyID    string
	Key      *ecdsa.PrivateKey
}

func CredentialsFromEnv

func CredentialsFromEnv() (Credentials, error)

func CredentialsFromValues

func CredentialsFromValues(issuerID, keyID, keyPath string) (Credentials, error)

func (Credentials) Token

func (c Credentials) Token(now time.Time) (string, error)

type FetchOptions added in v1.1.0

type FetchOptions struct {
	AgeRating        bool
	Accessibility    bool
	LicenseAgreement bool
	Screenshots      bool
	DownloadAssets   bool
	AppPreviews      bool
	Availability     bool
	Pricing          bool
}

FetchOptions limits optional App Store Connect resources to the features a configuration manages. This keeps existing projects usable with least- privilege API keys that cannot access newly supported resource families.

type Localization

type Localization struct {
	AppInfoLocalizationID string
	VersionLocalizationID string
	Values                map[string]string
}

type Metadata

type Metadata struct {
	AppID                    string
	AppInfoID                string
	VersionID                string
	AgeRatingID              string
	LicenseAgreementID       string
	Accessibility            map[string]AccessibilityDeclaration
	Screenshots              map[string]map[string][]Asset
	ScreenshotSetIDs         map[string]map[string]string
	AppPreviews              map[string]map[string][]Asset
	AppPreviewSetIDs         map[string]map[string]string
	AvailabilityID           string
	TerritoryAvailabilityIDs map[string]string
	PriceScheduleID          string
	Values                   map[string]string
	Localizations            map[string]Localization
}

func (Metadata) Locales

func (m Metadata) Locales() []string

type Option

type Option func(*Client)

func WithTimeout

func WithTimeout(timeout time.Duration) Option

type PricePoint added in v1.1.0

type PricePoint struct {
	ID            string
	CustomerPrice string
	Proceeds      string
}

type ReleaseOperation added in v1.2.0

type ReleaseOperation struct {
	Action      string `json:"action"`
	Resource    string `json:"resource"`
	Description string `json:"description"`
}

ReleaseOperation is one mutation in a release plan. Plans are deliberately serializable so CI can inspect the exact work an execution would perform.

type ReviewSubmissionStatus added in v1.2.0

type ReviewSubmissionStatus struct {
	ID            string `json:"id"`
	State         string `json:"state"`
	SubmittedDate string `json:"submitted_date,omitempty"`
}

type SubmitOptions added in v1.2.0

type SubmitOptions struct {
	BuildVersion        string
	ReleaseType         string
	EarliestReleaseDate string
}

type TestFlightDistributionOptions added in v1.2.0

type TestFlightDistributionOptions struct {
	BuildVersion string
	GroupNames   []string
}

type TestFlightDistributionPlan added in v1.2.0

type TestFlightDistributionPlan struct {
	Kind            string             `json:"kind"`
	AppID           string             `json:"app_id"`
	BundleID        string             `json:"bundle_id"`
	Platform        string             `json:"platform"`
	Version         string             `json:"version"`
	Build           string             `json:"build"`
	BetaReviewState string             `json:"beta_review_state,omitempty"`
	Groups          []TestFlightGroup  `json:"groups"`
	Operations      []ReleaseOperation `json:"operations"`
	// contains filtered or unexported fields
}

TestFlightDistributionPlan is the read-only preflight shared by dry-run and execution. Resource IDs remain private so only a plan created by this client can be applied.

type TestFlightGroup added in v1.2.0

type TestFlightGroup struct {
	Name     string `json:"name"`
	Internal bool   `json:"internal"`
	Attached bool   `json:"attached"`
	// contains filtered or unexported fields
}

TestFlightGroup is a resolved beta group in a distribution plan.

type TestFlightStatus added in v1.2.0

type TestFlightStatus struct {
	AppID  string        `json:"app_id"`
	Builds []BuildStatus `json:"builds"`
}

Jump to

Keyboard shortcuts

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