shared

package
v1.260504.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: MIT Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LocalizationTypeVersion = "version"
	LocalizationTypeAppInfo = "app-info"
)
View Source
const (
	PrivateKeyEnvVar       = privateKeyEnvVar
	PrivateKeyBase64EnvVar = privateKeyBase64EnvVar
)
View Source
const (
	SubmitReadinessCreateModePlanned = "planned"
	SubmitReadinessCreateModeApplied = "applied"
)
View Source
const PublishDefaultPollInterval = 30 * time.Second

PublishDefaultPollInterval is the default polling interval for build discovery.

View Source
const (
	ReportFormatJUnit = "junit"
)

CI report format types

Variables

View Source
var ErrMissingAuth = errors.New("missing authentication")

Functions

func AppUpdateRequiresWhatsNew added in v1.260407.0

func AppUpdateRequiresWhatsNew(ctx context.Context, client *asc.Client, appID, platform string) (bool, error)

AppUpdateRequiresWhatsNew returns true when the target app/platform has a previously released App Store version, which means whatsNew is required on every localization for update submissions.

func ApplyRootLoggingOverrides

func ApplyRootLoggingOverrides()

ApplyRootLoggingOverrides applies root-level logging flag overrides (--retry-log, --debug, --api-debug) into the shared ASC runtime.

func BindCIFlags

func BindCIFlags(fs *flag.FlagSet)

BindCIFlags registers CI-related flags for report output. These are separate from BindRootFlags to keep CI concerns isolated.

func BindPrettyJSONFlag

func BindPrettyJSONFlag(fs *flag.FlagSet) *bool

BindPrettyJSONFlag registers a --pretty flag for JSON rendering.

func BindRootFlags

func BindRootFlags(fs *flag.FlagSet)

BindRootFlags registers root-level flags that affect shared CLI behavior.

func Bold

func Bold(s string) string

Bold returns the string wrapped in ANSI bold codes

func BuildAppKeywordsResponse

func BuildAppKeywordsResponse(keywords []string) *asc.AppKeywordsResponse

BuildAppKeywordsResponse converts a keyword list into the standard appKeywords response shape used by multiple keyword mutation commands.

func BuildConfirmDeleteCommand

func BuildConfirmDeleteCommand(config ConfirmDeleteCommandConfig) *ffcli.Command

BuildConfirmDeleteCommand builds a standard delete command requiring --id and --confirm and printing a caller-provided result payload.

func BuildIDGetCommand

func BuildIDGetCommand(config IDGetCommandConfig) *ffcli.Command

BuildIDGetCommand builds a standard "get by ID" command.

func BuildPaginatedListCommand

func BuildPaginatedListCommand(config PaginatedListCommandConfig) *ffcli.Command

BuildPaginatedListCommand builds a list command that supports --next and --paginate semantics shared by many resources.

func BuildPricePointEqualizationsCommand added in v1.260407.0

func BuildPricePointEqualizationsCommand(config PricePointEqualizationsCommandConfig) *ffcli.Command

BuildPricePointEqualizationsCommand builds a standard equalizations list command with shared help/examples and --limit/--next/--paginate semantics.

func CanonicalizeAppStoreLocalizationLocale added in v1.260407.0

func CanonicalizeAppStoreLocalizationLocale(value string) (string, error)

CanonicalizeAppStoreLocalizationLocale canonicalizes known locale codes, rejects shorthand roots when the catalog only supports region/script-specific variants, and preserves unknown well-formed locale codes for forward compatibility.

func CleanupTempPrivateKeys

func CleanupTempPrivateKeys()

CleanupTempPrivateKeys removes any temporary private key files created during this run.

func CommitBuildUploadFile added in v1.260404.0

func CommitBuildUploadFile(ctx context.Context, client *asc.Client, fileID string, checksums *asc.Checksums) (*asc.BuildUploadFileResponse, error)

CommitBuildUploadFile marks a reserved upload file as uploaded and optionally persists source-file checksums.

func CompareRFC3339DateStrings added in v1.260331.0

func CompareRFC3339DateStrings(current, best string) int

CompareRFC3339DateStrings compares two RFC3339 timestamps, falling back to trimmed string comparison when parsing fails.

func ContextWithResolvedTimeout

func ContextWithResolvedTimeout(ctx context.Context, defaultTimeout time.Duration) (context.Context, context.CancelFunc)

ContextWithResolvedTimeout returns a context with ASC timeout resolution and a package-provided default fallback duration.

func ContextWithTimeout

func ContextWithTimeout(ctx context.Context) (context.Context, context.CancelFunc)

func ContextWithTimeoutDuration

func ContextWithTimeoutDuration(ctx context.Context, timeout time.Duration) (context.Context, context.CancelFunc)

ContextWithTimeoutDuration creates a context with a specific timeout.

func ContextWithUploadTimeout

func ContextWithUploadTimeout(ctx context.Context) (context.Context, context.CancelFunc)

func ContextWithoutTimeout

func ContextWithoutTimeout(ctx context.Context) context.Context

func CopyVersionMetadataFromSource

func CopyVersionMetadataFromSource(
	ctx context.Context,
	client *asc.Client,
	opts VersionMetadataCopyOptions,
) (*asc.AppStoreVersionMetadataCopySummary, error)

CopyVersionMetadataFromSource copies selected localization metadata from one version into another.

func DecompressGzipFile

func DecompressGzipFile(sourcePath, destPath string) (int64, error)

DecompressGzipFile inflates a gzip file to the destination path.

func DefaultOutputFormat

func DefaultOutputFormat() string

DefaultOutputFormat returns the default output format for CLI commands. It checks ASC_DEFAULT_OUTPUT first. When unset, interactive terminals default to table output and non-interactive contexts default to JSON. Valid ASC_DEFAULT_OUTPUT values are "json", "table", "markdown", and "md".

func DefaultUsageFunc

func DefaultUsageFunc(c *ffcli.Command) string

DefaultUsageFunc returns a usage string with bold section headers

func DeprecatedAliasLeafCommand

func DeprecatedAliasLeafCommand(cmd *ffcli.Command, name, shortUsage, newCommand, warning string) *ffcli.Command

DeprecatedAliasLeafCommand clones a canonical leaf command into a deprecated compatibility alias that warns and then delegates to the canonical Exec.

func DeprecatedUsageFunc

func DeprecatedUsageFunc(c *ffcli.Command) string

DeprecatedUsageFunc returns a compact usage string for compatibility aliases. It intentionally omits flags and subcommands so help output only points callers to the canonical command path.

func FetchAllAppStoreVersions added in v1.260331.0

func FetchAllAppStoreVersions(ctx context.Context, client *asc.Client, appID string, opts ...asc.AppStoreVersionsOption) ([]asc.Resource[asc.AppStoreVersionAttributes], error)

FetchAllAppStoreVersions returns all App Store versions for an app, following pagination links.

func FetchAllReviewSubmissions added in v1.260331.0

func FetchAllReviewSubmissions(ctx context.Context, client *asc.Client, appID string, opts ...asc.ReviewSubmissionsOption) ([]asc.ReviewSubmissionResource, error)

FetchAllReviewSubmissions returns all review submissions for an app, following pagination links.

func FindPreReleaseVersionIDs added in v1.260404.0

func FindPreReleaseVersionIDs(ctx context.Context, client *asc.Client, appID, version, platform string) ([]string, error)

FindPreReleaseVersionIDs returns the exact-matching pre-release version IDs for the provided app/version/platform filters.

func FormatSubmitReadinessCreateWarning added in v1.260407.0

func FormatSubmitReadinessCreateWarning(warning SubmitReadinessCreateWarning) string

FormatSubmitReadinessCreateWarning returns the user-facing warning line.

func GetASCClient

func GetASCClient() (*asc.Client, error)

Exported wrappers for shared helpers.

func GetASCClientWithTimeout added in v1.260331.0

func GetASCClientWithTimeout(timeout time.Duration) (*asc.Client, error)

func HasInclude

func HasInclude(values []string, include string) bool

HasInclude returns true when include is present in values.

func HideFlagFromHelp

func HideFlagFromHelp(f *flag.Flag)

HideFlagFromHelp hides a flag from command help output while keeping it accepted at runtime.

func IsAppAvailabilityMissing

func IsAppAvailabilityMissing(err error) bool

func IsNumericAppID added in v1.260407.0

func IsNumericAppID(value string) bool

IsNumericAppID reports whether a value is a non-empty decimal app ID.

func ListAllBetaGroups

func ListAllBetaGroups(ctx context.Context, client betaGroupsClient, appID string) (*asc.BetaGroupsResponse, error)

ListAllBetaGroups fetches and paginates all beta groups for an app.

func LocaleRoot added in v1.260407.0

func LocaleRoot(value string) string

LocaleRoot returns the lowercased language root for a locale code.

func MapTerritoryAvailabilityIDs

func MapTerritoryAvailabilityIDs(resp *asc.TerritoryAvailabilitiesResponse) (map[string]string, error)

MapTerritoryAvailabilityIDs maps territory IDs to territory-availability IDs.

func MapVersionLocalizationStrings

func MapVersionLocalizationStrings(attrs asc.AppStoreVersionLocalizationAttributes) map[string]string

MapVersionLocalizationStrings converts version localization attributes into .strings keys.

func MergeNextURLQuery added in v1.260331.0

func MergeNextURLQuery(next string, additions url.Values) (string, error)

MergeNextURLQuery reapplies required query parameters to a validated next URL.

func MissingSubmitRequiredLocalizationFields

func MissingSubmitRequiredLocalizationFields(attrs asc.AppStoreVersionLocalizationAttributes) []string

MissingSubmitRequiredLocalizationFields returns missing metadata fields that block App Store submission for a version localization.

func MissingSubmitRequiredLocalizationFieldsWithOptions

func MissingSubmitRequiredLocalizationFieldsWithOptions(attrs asc.AppStoreVersionLocalizationAttributes, opts SubmitReadinessOptions) []string

MissingSubmitRequiredLocalizationFieldsWithOptions returns missing metadata fields that block App Store submission, with configurable checks.

func NewAvailabilitySetCommand

func NewAvailabilitySetCommand(config AvailabilitySetCommandConfig) *ffcli.Command

NewAvailabilitySetCommand builds a shared availability set command.

func NewCategoriesSetCommand

func NewCategoriesSetCommand(config CategoriesSetCommandConfig) *ffcli.Command

NewCategoriesSetCommand builds a categories set command with shared behavior.

func NewPricingSetCommand

func NewPricingSetCommand(config PricingSetCommandConfig) *ffcli.Command

NewPricingSetCommand builds a pricing set command with shared behavior.

func NewReportedError

func NewReportedError(err error) error

NewReportedError wraps an error that has already been printed.

func NormalizeASCTerritoryCSV added in v1.260407.0

func NormalizeASCTerritoryCSV(value string) ([]string, error)

func NormalizeAppStoreLocalizationLocale added in v1.260407.0

func NormalizeAppStoreLocalizationLocale(value string) (string, error)

NormalizeAppStoreLocalizationLocale validates locale syntax and canonicalizes known codes. Unknown but well-formed locale codes are preserved for forward compatibility.

func NormalizeAppStoreVersionPlatform

func NormalizeAppStoreVersionPlatform(value string) (string, error)

NormalizeAppStoreVersionPlatform validates a single platform value.

func NormalizeAppStoreVersionPlatforms

func NormalizeAppStoreVersionPlatforms(values []string) ([]string, error)

NormalizeAppStoreVersionPlatforms validates multiple platform values.

func NormalizeAppStoreVersionStates

func NormalizeAppStoreVersionStates(values []string) ([]string, error)

NormalizeAppStoreVersionStates validates multiple state values.

func NormalizeBuildProcessingStateFilter

func NormalizeBuildProcessingStateFilter(raw string, options BuildProcessingStateFilterOptions) ([]string, error)

NormalizeBuildProcessingStateFilter parses and validates CSV processing-state filters (including "all"), deduplicates values, and applies optional aliases.

func NormalizeDate

func NormalizeDate(value, flagName string) (string, error)

func NormalizeEnumToken

func NormalizeEnumToken(value string) string

NormalizeEnumToken normalizes enum-like flag values by uppercasing and converting separators to underscore form.

func NormalizeLocaleCode added in v1.260407.0

func NormalizeLocaleCode(value string) string

NormalizeLocaleCode trims whitespace and canonicalizes separators for locale codes.

func NormalizeLocalizationType

func NormalizeLocalizationType(value string) (string, error)

func NormalizeOutputFormat

func NormalizeOutputFormat(format string) string

NormalizeOutputFormat lowercases format and canonicalizes aliases.

func NormalizePlatform

func NormalizePlatform(value string) (asc.Platform, error)

NormalizePlatform validates and normalizes a platform string.

func NormalizeReviewSubmissionStates

func NormalizeReviewSubmissionStates(values []string) ([]string, error)

NormalizeReviewSubmissionStates validates multiple review submission state values.

func NormalizeSelection

func NormalizeSelection(value string, allowed []string, flagName string) ([]string, error)

NormalizeSelection validates comma-separated values against an allow-list.

func NormalizeVersionMetadataCopyFields

func NormalizeVersionMetadataCopyFields(value, flagName string) ([]string, error)

NormalizeVersionMetadataCopyFields validates a comma-separated field list against version localization keys.

func NormalizeViewEditCommandTree added in v1.260325.0

func NormalizeViewEditCommandTree(root *ffcli.Command, editPaths map[string]struct{}) *ffcli.Command

NormalizeViewEditCommandTree rewrites canonical leaf verbs so user-facing read commands prefer `view` over `get`, and a small allowlist of update-only commands prefer `edit` over `set`.

func OpenExistingNoFollow

func OpenExistingNoFollow(path string) (*os.File, error)

OpenExistingNoFollow opens an existing file without following symlinks.

func OpenNewFileNoFollow

func OpenNewFileNoFollow(path string, perm os.FileMode) (*os.File, error)

OpenNewFileNoFollow creates a new file without following symlinks. Uses O_EXCL to prevent overwriting existing files and O_NOFOLLOW to prevent symlink attacks.

func OrNA

func OrNA(value string) string

OrNA trims a string and returns "n/a" when empty.

func PaginateWithSpinner

func PaginateWithSpinner(ctx context.Context, fetch FetchFunc, next asc.PaginateFunc) (asc.PaginatedResponse, error)

PaginateWithSpinner fetches all pages with a spinner on stderr. It wraps both the initial fetch and the pagination loop so the spinner is visible even for single-page results.

func ParseBoolFlag

func ParseBoolFlag(value, flagName string) (bool, error)

ParseBoolFlag parses common bool-like flag values and returns a usage-style error with the provided flagName when parsing fails.

func ParseBuildTimestamp added in v1.260404.0

func ParseBuildTimestamp(value string) (time.Time, error)

ParseBuildTimestamp parses ASC uploadedDate values used across build helpers.

func ParseOptionalBoolFlag

func ParseOptionalBoolFlag(name, raw string) (*bool, error)

ParseOptionalBoolFlag parses an optional boolean flag value.

func ParseRFC3339Date added in v1.260331.0

func ParseRFC3339Date(value string) (time.Time, bool)

ParseRFC3339Date parses a timestamp in RFC3339 or RFC3339Nano form.

func PlatformList

func PlatformList() []string

PlatformList returns the allowed platform values.

func PrepareBuildUpload added in v1.260404.0

func PrepareBuildUpload(ctx context.Context, client *asc.Client, appID string, fileInfo os.FileInfo, version, buildNumber string, platform asc.Platform, uti asc.UTI) (*asc.BuildUploadResponse, *asc.BuildUploadFileResponse, error)

PrepareBuildUpload creates the build upload and file reservation records used by publish/build upload flows before the binary is transferred.

func PrintOutput

func PrintOutput(data any, format string, pretty bool) error

func PrintOutputWithRenderers

func PrintOutputWithRenderers(data any, format string, pretty bool, tableRenderer, markdownRenderer func() error) error

func PrintResolvedPrices added in v1.260331.0

func PrintResolvedPrices(result *ResolvedPricesResult, format string, pretty bool) error

PrintResolvedPrices renders resolved price rows without registering global raw renderers.

func PrintStreamPage

func PrintStreamPage(data any) error

PrintStreamPage writes a single page of data as a JSON line to stdout. Used with --stream --paginate to emit results page-by-page as NDJSON instead of buffering all pages in memory.

func PrintSubmitReadinessCreateWarnings added in v1.260407.0

func PrintSubmitReadinessCreateWarnings(w io.Writer, warnings []SubmitReadinessCreateWarning) error

PrintSubmitReadinessCreateWarnings emits normalized warnings to the writer.

func ProgressEnabled

func ProgressEnabled() bool

ProgressEnabled reports whether it's safe/appropriate to emit progress messages. Progress must be stderr-only and must not appear when stderr is non-interactive.

func ReadJSONFilePayload

func ReadJSONFilePayload(path string) (json.RawMessage, error)

ReadJSONFilePayload loads a JSON object from a file path for commands that accept raw payload documents.

func ReadLocalizationStrings

func ReadLocalizationStrings(inputPath string, locales []string) (map[string]map[string]string, error)

func RecoverBoolFlagTailArgs

func RecoverBoolFlagTailArgs(original *flag.FlagSet, args []string, currentValue *bool) error

RecoverBoolFlagTailArgs reparses leftover args when the standard flag parser stops after a space-separated boolean value for a bool flag. This preserves support for `--flag`, `--flag=true`, and `--flag=false` while also recovering `--flag true` / `--flag false` for commands that don't accept positional args.

func RenderSection

func RenderSection(title string, headers []string, rows [][]string, markdown bool)

RenderSection renders a titled section as markdown or table output.

func ReportFile

func ReportFile() string

ReportFile returns the configured report file path.

func ReportFormat

func ReportFormat() string

ReportFormat returns the configured report format.

func RequireAppForStableSelector added in v1.260404.0

func RequireAppForStableSelector(appID, selector, flagName string) error

RequireAppForStableSelector returns a usage error when a non-numeric selector needs app context.

func ResetDefaultOutputFormat

func ResetDefaultOutputFormat()

ResetDefaultOutputFormat clears the cached default output format so that DefaultOutputFormat() re-reads ASC_DEFAULT_OUTPUT on its next call. Tests only.

func ResetTierCacheForTest added in v1.260325.0

func ResetTierCacheForTest()

ResetTierCacheForTest routes tier-cache reads and writes to an isolated temp dir for tests.

func ResolveAppID

func ResolveAppID(appID string) string

func ResolveAppIDWithExactLookup

func ResolveAppIDWithExactLookup(ctx context.Context, client appLookupClient, appID string) (string, error)

ResolveAppIDWithExactLookup takes an already-resolved app identifier and looks it up by exact bundle ID and exact app name only. If no exact match exists and the value is numeric, it falls back to treating it as an App Store Connect app ID.

func ResolveAppIDWithLookup

func ResolveAppIDWithLookup(ctx context.Context, client appLookupClient, appID string) (string, error)

ResolveAppIDWithLookup takes an already-resolved app identifier and, when non-numeric, looks it up by exact bundle ID, exact app name, then legacy fuzzy-name matching when unique.

func ResolveAppInfoID

func ResolveAppInfoID(ctx context.Context, client *asc.Client, appID, appInfoID string) (string, error)

ResolveAppInfoID resolves the app info ID, optionally using a provided override.

func ResolveAppStoreVersionID

func ResolveAppStoreVersionID(ctx context.Context, client *asc.Client, appID, version, platform string) (string, error)

ResolveAppStoreVersionID finds a version ID by version string and platform.

func ResolveAppStoreVersionIDAndState

func ResolveAppStoreVersionIDAndState(ctx context.Context, client *asc.Client, appID, version, platform string) (string, string, error)

ResolveAppStoreVersionIDAndState finds a version ID and state by version string and platform.

func ResolveAppStoreVersionState

func ResolveAppStoreVersionState(attrs asc.AppStoreVersionAttributes) string

ResolveAppStoreVersionState prefers the app version state when available.

func ResolveBundleInfoForIPA added in v1.260404.0

func ResolveBundleInfoForIPA(ipaPath, version, buildNumber string) (string, string, error)

ResolveBundleInfoForIPA fills missing version/build-number values from the IPA and preserves the existing CLI-facing error messages.

func ResolveFreeAppPricePoint added in v1.260328.0

func ResolveFreeAppPricePoint(ctx context.Context, client *asc.Client, appID, territory string) (string, error)

ResolveFreeAppPricePoint finds the free ($0) price point ID for an app in a territory.

func ResolveIAPID added in v1.260404.0

func ResolveIAPID(ctx context.Context, client iapSelectorClient, appID, selector string) (string, error)

ResolveIAPID resolves an in-app purchase selector to its canonical ASC ID.

func ResolveLatestBuild added in v1.260404.0

func ResolveLatestBuild(ctx context.Context, client *asc.Client, opts LatestBuildSelectionOptions, allowEmpty bool) (*asc.BuildResponse, error)

ResolveLatestBuild finds the latest processed build matching the provided app/version/platform filters. When allowEmpty is true, nil is returned when no matching build exists.

func ResolveNextBuildNumber added in v1.260404.0

func ResolveNextBuildNumber(ctx context.Context, client *asc.Client, opts NextBuildNumberOptions) (*asc.BuildsNextBuildNumberResult, error)

ResolveNextBuildNumber compares the latest processed build and the latest in-flight build upload, then returns the next safe build number.

func ResolveOwnedAppStoreVersionByID added in v1.260404.0

func ResolveOwnedAppStoreVersionByID(ctx context.Context, client *asc.Client, appID, versionID, platform string) (asc.Resource[asc.AppStoreVersionAttributes], error)

ResolveOwnedAppStoreVersionByID fetches a version by ID and validates its app ownership and optional platform.

func ResolvePricePointByPrice

func ResolvePricePointByPrice(tiers []TierEntry, price string) (string, error)

ResolvePricePointByPrice finds the price point ID for a given customer price.

func ResolvePricePointByTier

func ResolvePricePointByTier(tiers []TierEntry, tier int) (string, error)

ResolvePricePointByTier finds the price point ID for a given tier number.

func ResolveProfileName

func ResolveProfileName() string

func ResolveReportOutputPaths

func ResolveReportOutputPaths(outputPath, defaultCompressed, decompressedExt string, decompress bool) (string, string)

ResolveReportOutputPaths returns compressed/decompressed paths for reports.

func ResolveSubscriptionID added in v1.260404.0

func ResolveSubscriptionID(ctx context.Context, client subscriptionSelectorClient, appID, selector string) (string, error)

ResolveSubscriptionID resolves a subscription selector to its canonical ASC ID.

func ResolveVendorNumber

func ResolveVendorNumber(value string) string

ResolveVendorNumber resolves the vendor number for reports.

func ResolveVersionMetadataCopyFields

func ResolveVersionMetadataCopyFields(copyFields, excludeFields []string) ([]string, error)

ResolveVersionMetadataCopyFields applies explicit includes/excludes to the supported metadata field set.

func RewriteCommandTreePath

func RewriteCommandTreePath(cmd *ffcli.Command, currentPrefix, replacementPrefix string) *ffcli.Command

RewriteCommandTreePath rewrites usage/help path prefixes for an existing command tree.

func SafeWriteFileNoSymlink(path string, perm os.FileMode, overwrite bool, tempPattern string, backupPattern string, write func(*os.File) (int64, error)) (int64, error)

SafeWriteFileNoSymlink writes a file to path without following symlinks and with an optional overwrite mode that preserves the original destination until the new file is fully written.

When overwrite is false, the destination must not already exist. When overwrite is true, we refuse to overwrite symlinks and we use temp+rename; if rename fails because the destination exists (notably on Windows), we fall back to a safe replace that uses a backup file to preserve the original if the final move fails.

func SanitizeTerminal

func SanitizeTerminal(input string) string

SanitizeTerminal strips ASCII control characters to prevent terminal escape injection.

func SaveTierCache

func SaveTierCache(appID, territory string, tiers []TierEntry) error

SaveTierCache writes tier data to the cache file.

func SelectBestAppInfoID

func SelectBestAppInfoID(appInfos *asc.AppInfosResponse) string

SelectBestAppInfoID chooses the most editable app info for updates.

func SelectedProfile

func SelectedProfile() string

SelectedProfile returns the current profile override.

func SelectorNeedsLookup added in v1.260404.0

func SelectorNeedsLookup(value string) bool

SelectorNeedsLookup reports whether a selector needs app-scoped lookup instead of direct ASC ID passthrough.

func SetBuildUploadFailureDiagnosticsForTesting

func SetBuildUploadFailureDiagnosticsForTesting(fn func(context.Context, *asc.Client, string, *asc.BuildUploadResponse) (string, error)) func()

SetBuildUploadFailureDiagnosticsForTesting overrides build failure enrichment. Tests only.

func SetNoProgress

func SetNoProgress(value bool)

SetNoProgress sets progress suppression (tests only).

func SetReportFile

func SetReportFile(path string)

SetReportFile sets the report file path (for testing).

func SetReportFormat

func SetReportFormat(format string)

SetReportFormat sets the report format (for testing).

func SetSelectedProfile

func SetSelectedProfile(value string)

SetSelectedProfile sets the current profile override (tests only).

func ShouldPreferLatestReviewSubmission added in v1.260331.0

func ShouldPreferLatestReviewSubmission(current, best asc.ReviewSubmissionResource) bool

ShouldPreferLatestReviewSubmission reports whether current should win over best when selecting the most relevant submission.

func SortResolvedPrices added in v1.260331.0

func SortResolvedPrices(rows []ResolvedPriceRow)

SortResolvedPrices orders prices deterministically for stable output.

func SpinnerEnabled

func SpinnerEnabled() bool

SpinnerEnabled reports whether the CLI should render an indeterminate spinner on stderr for the current run.

Requirements:

  • stderr-only (handled by WithSpinner)
  • TTY-gated (stdout + stderr)
  • opt-out via ASC_SPINNER_DISABLED (invalid => disabled)
  • disabled when stderr is expected to be noisy (debug/retry logs)

func SplitCSV

func SplitCSV(value string) []string

func SplitCSVUpper

func SplitCSVUpper(value string) []string

func SplitUniqueCSV

func SplitUniqueCSV(value string) []string

func SubmitIncompleteLocaleWarning added in v1.260407.0

func SubmitIncompleteLocaleWarning(locale string, attrs asc.AppStoreVersionLocalizationAttributes) string

SubmitIncompleteLocaleWarning returns a user-facing warning when a locale is missing submit-required metadata fields.

func SubmitIncompleteLocaleWarningWithOptions added in v1.260407.0

func SubmitIncompleteLocaleWarningWithOptions(locale string, attrs asc.AppStoreVersionLocalizationAttributes, opts SubmitReadinessOptions) string

SubmitIncompleteLocaleWarningWithOptions returns a user-facing warning when a locale is missing submit-required metadata fields under the provided rules.

func SuggestCanonicalLocaleCodes added in v1.260407.0

func SuggestCanonicalLocaleCodes(value string, supported []string, canonicalByFold map[string]string) []string

SuggestCanonicalLocaleCodes returns deduplicated canonical locale suggestions for fuzzy input.

func SupportedMetadataLocales added in v1.260407.0

func SupportedMetadataLocales() []string

SupportedMetadataLocales returns the metadata-compatible subset of the shared App Store localization catalog.

func UploadAppInfoLocalizations

func UploadAppInfoLocalizations(ctx context.Context, client appInfoLocalizationClient, appInfoID string, valuesByLocale map[string]map[string]string, dryRun bool) ([]asc.LocalizationUploadLocaleResult, error)

func UploadVersionLocalizations

func UploadVersionLocalizations(ctx context.Context, client versionLocalizationClient, versionID string, valuesByLocale map[string]map[string]string, dryRun bool) ([]asc.LocalizationUploadLocaleResult, error)

func UpsertBetaBuildLocalization

func UpsertBetaBuildLocalization(ctx context.Context, client *asc.Client, buildID, locale, notes string) (*asc.BetaBuildLocalizationResponse, error)

UpsertBetaBuildLocalization creates or updates a beta build localization.

func UsageError

func UsageError(message string) error

UsageError prints a CLI validation error and returns flag.ErrHelp so callers map the failure to usage exit code semantics.

func UsageErrorf

func UsageErrorf(format string, args ...any) error

UsageErrorf formats and returns a usage-class validation error.

func ValidateAppInfoLocalizationKeys

func ValidateAppInfoLocalizationKeys(locale string, values map[string]string) error

ValidateAppInfoLocalizationKeys validates .strings keys for an app-info localization locale.

func ValidateBoundOutputFlags

func ValidateBoundOutputFlags(fs *flag.FlagSet) error

ValidateBoundOutputFlags validates any output-format flags bound via the shared output helpers on the provided flagset.

func ValidateBuildLocalizationLocale

func ValidateBuildLocalizationLocale(locale string) error

ValidateBuildLocalizationLocale validates a locale string.

func ValidateBuildLocalizationLocales

func ValidateBuildLocalizationLocales(locales []string) error

ValidateBuildLocalizationLocales validates multiple locale strings.

func ValidateFinitePriceFlag

func ValidateFinitePriceFlag(flagName, value string) error

ValidateFinitePriceFlag validates a numeric flag value that must be finite.

func ValidateIPAPath added in v1.260404.0

func ValidateIPAPath(ipaPath string) (os.FileInfo, error)

ValidateIPAPath ensures an IPA path points to a regular file and rejects symlinks so upload commands don't accidentally dereference unexpected files.

func ValidateNextURL

func ValidateNextURL(next string) error

func ValidateOutputFormat

func ValidateOutputFormat(format string, pretty bool) (string, error)

func ValidateOutputFormatAllowed

func ValidateOutputFormatAllowed(format string, pretty bool, allowed ...string) (string, error)

func ValidatePriceSelectionFlags

func ValidatePriceSelectionFlags(pricePoint string, tier int, price string, free ...bool) error

ValidatePriceSelectionFlags checks that --price-point, --tier, --price, and --free are mutually exclusive. Returns a usage-style error if more than one is set.

func ValidateReportFlags

func ValidateReportFlags() error

ValidateReportFlags validates the CI report flags and returns an error if invalid.

func ValidateSort

func ValidateSort(value string, allowed ...string) error

func ValidateVersionLocalizationAttributes added in v1.260407.0

func ValidateVersionLocalizationAttributes(attrs asc.AppStoreVersionLocalizationAttributes) error

ValidateVersionLocalizationAttributes validates version localization field limits.

func ValidateVersionLocalizationAttributesByLocale added in v1.260407.0

func ValidateVersionLocalizationAttributesByLocale(valuesByLocale map[string]asc.AppStoreVersionLocalizationAttributes) error

ValidateVersionLocalizationAttributesByLocale validates attribute values for all locales.

func ValidateVersionLocalizationKeys

func ValidateVersionLocalizationKeys(locale string, values map[string]string) error

ValidateVersionLocalizationKeys validates .strings keys for a version localization locale.

func ValidateVersionLocalizationValueSet added in v1.260407.0

func ValidateVersionLocalizationValueSet(valuesByLocale map[string]map[string]string) error

ValidateVersionLocalizationValueSet validates value maps for all locales.

func ValidateVersionLocalizationValues added in v1.260407.0

func ValidateVersionLocalizationValues(locale string, values map[string]string) error

ValidateVersionLocalizationValues validates .strings keys and value limits for one locale.

func VerifyBuildUploadAfterCommit

func VerifyBuildUploadAfterCommit(ctx context.Context, client *asc.Client, appID, uploadID string, pollInterval, verifyTimeout time.Duration) error

VerifyBuildUploadAfterCommit briefly watches a newly committed upload for immediate App Store Connect failures. It returns nil on timeout so the caller can keep the default asynchronous success behavior when no failure is observed during the bounded verification window.

func VersionLocalizationKeys

func VersionLocalizationKeys() []string

VersionLocalizationKeys returns the supported app store version localization keys.

func VisibleHelpFlags

func VisibleHelpFlags(fs *flag.FlagSet) []*flag.Flag

VisibleHelpFlags returns the flags that should appear in help output.

func VisibleUsageFunc

func VisibleUsageFunc(c *ffcli.Command) string

VisibleUsageFunc renders command help while omitting deprecated aliases from nested subcommand listings. Root-level deprecated commands are already hidden elsewhere; this keeps nested canonical help focused on current surfaces.

func WaitForBuildByNumberOrUploadFailure

func WaitForBuildByNumberOrUploadFailure(ctx context.Context, client *asc.Client, appID, uploadID, version, buildNumber, platform string, pollInterval time.Duration) (*asc.BuildResponse, error)

WaitForBuildByNumberOrUploadFailure waits for a build matching version/build number to appear while also watching the originating build upload for early failure states. This prevents long hangs when App Store Connect rejects the uploaded artifact before a build record is created.

func WithSpinner

func WithSpinner(label string, fn func() error) (err error)

WithSpinner runs fn while rendering a gh-style indeterminate spinner on stderr. It is a no-op when SpinnerEnabled() is false.

func WithSpinnerDelayed

func WithSpinnerDelayed(label string, delay time.Duration, fn func() error) (err error)

WithSpinnerDelayed runs fn while rendering a gh-style indeterminate spinner on stderr, but only starts the spinner after delay has elapsed.

This avoids spinner “flicker” for fast operations while still providing feedback for slower operations (e.g., keychain prompts).

func WrapCommandOutputValidation

func WrapCommandOutputValidation(cmd *ffcli.Command)

WrapCommandOutputValidation ensures shared output flags are validated before command execution so invalid format combinations fail before side effects.

func WriteAppInfoLocalizationStrings

func WriteAppInfoLocalizationStrings(outputPath string, items []asc.Resource[asc.AppInfoLocalizationAttributes]) ([]asc.LocalizationFileResult, error)

func WriteFileNoSymlinkOverwrite

func WriteFileNoSymlinkOverwrite(path string, reader io.Reader, perm os.FileMode, tempPattern string, backupPattern string) (int64, error)

WriteFileNoSymlinkOverwrite writes reader to path via temp+rename. It refuses to overwrite symlinks and uses a Windows-safe replace when needed.

func WriteProfileFile

func WriteProfileFile(path string, content []byte) error

WriteProfileFile writes provisioning profile data to disk securely.

func WriteStreamToFile

func WriteStreamToFile(path string, reader io.Reader) (int64, error)

WriteStreamToFile writes a reader to a file securely.

func WriteVersionLocalizationStrings

func WriteVersionLocalizationStrings(outputPath string, items []asc.Resource[asc.AppStoreVersionLocalizationAttributes]) ([]asc.LocalizationFileResult, error)

Types

type ASCTerritoryValuePair added in v1.260407.0

type ASCTerritoryValuePair struct {
	TerritoryID string
	Value       string
}

func ParseASCTerritoryValueCSV added in v1.260407.0

func ParseASCTerritoryValueCSV(value string) ([]ASCTerritoryValuePair, error)

type AddBuildBetaGroupsOptions

type AddBuildBetaGroupsOptions struct {
	SkipInternal              bool
	SkipInternalWithAllBuilds bool
	Notify                    bool
}

AddBuildBetaGroupsOptions controls how resolved groups are assigned to a build.

type AddBuildBetaGroupsResult

type AddBuildBetaGroupsResult struct {
	AddedGroupIDs                  []string
	SkippedInternalGroups          []ResolvedBetaGroup
	SkippedInternalAllBuildsGroups []ResolvedBetaGroup
	NotificationAction             asc.BuildBetaGroupsNotificationAction
}

AddBuildBetaGroupsResult reports the final add/skipped group sets.

func AddBuildBetaGroups

func AddBuildBetaGroups(ctx context.Context, client buildBetaGroupsMutationClient, buildID string, groups []ResolvedBetaGroup, opts AddBuildBetaGroupsOptions) (*AddBuildBetaGroupsResult, error)

AddBuildBetaGroups applies resolved beta groups to a build, optionally skipping internal groups.

type AppStoreLocalizationLocale added in v1.260407.0

type AppStoreLocalizationLocale struct {
	Code             string `json:"code"`
	Name             string `json:"name"`
	SupportsMetadata bool   `json:"supportsMetadata"`
}

AppStoreLocalizationLocale describes one known App Store localization locale.

func AppStoreLocalizationCatalog added in v1.260407.0

func AppStoreLocalizationCatalog() []AppStoreLocalizationLocale

AppStoreLocalizationCatalog returns the known App Store localization catalog.

type AvailabilitySetCommandConfig

type AvailabilitySetCommandConfig struct {
	FlagSetName                      string
	CommandName                      string
	ShortUsage                       string
	ShortHelp                        string
	LongHelp                         string
	ErrorPrefix                      string
	IncludeAvailableInNewTerritories bool
}

AvailabilitySetCommandConfig configures the availability set command.

type BuildBetaReviewSubmissionResult added in v1.260425.0

type BuildBetaReviewSubmissionResult struct {
	Submitted    bool
	SubmissionID string
	Message      string
}

BuildBetaReviewSubmissionResult reports the beta app review submission outcome.

func SubmitBuildBetaReviewIfNeeded added in v1.260425.0

func SubmitBuildBetaReviewIfNeeded(ctx context.Context, client buildBetaReviewSubmissionClient, buildID string, groups []ResolvedBetaGroup, addedGroupIDs []string, submit bool, operationName string) (*BuildBetaReviewSubmissionResult, error)

SubmitBuildBetaReviewIfNeeded submits a build for beta app review when requested and when the build was added to at least one external beta group.

type BuildProcessingStateFilterOptions

type BuildProcessingStateFilterOptions struct {
	FlagName          string
	AllowedValuesHelp string
	Aliases           map[string]string
}

BuildProcessingStateFilterOptions customizes state normalization behavior for command-specific flag names/help text and optional aliases.

type CategoriesSetCommandConfig

type CategoriesSetCommandConfig struct {
	FlagSetName    string
	ShortUsage     string
	ShortHelp      string
	LongHelp       string
	ErrorPrefix    string
	IncludeAppInfo bool
}

CategoriesSetCommandConfig configures the categories set command.

type ConfirmDeleteCommandConfig

type ConfirmDeleteCommandConfig struct {
	FlagSetName string
	Name        string
	ShortUsage  string
	ShortHelp   string
	LongHelp    string

	IDFlag  string
	IDUsage string

	ErrorPrefix string

	ContextTimeout func(context.Context) (context.Context, context.CancelFunc)
	Delete         func(context.Context, *asc.Client, string) error
	Result         func(string) any
}

ConfirmDeleteCommandConfig configures a standard delete command requiring --id and --confirm.

type ExactSelectorCandidate added in v1.260404.0

type ExactSelectorCandidate struct {
	ID        string
	ProductID string
	Name      string
}

ExactSelectorCandidate is a resource that can be matched by ASC ID, product ID, or current name.

func ResolveExactSelectorCandidate added in v1.260404.0

func ResolveExactSelectorCandidate(selector, resourceName string, candidates []ExactSelectorCandidate) (ExactSelectorCandidate, error)

ResolveExactSelectorCandidate resolves a unique candidate by exact product ID first, then exact current name.

type FetchFunc

type FetchFunc func(ctx context.Context) (asc.PaginatedResponse, error)

FetchFunc fetches the first page of a paginated resource.

type IDGetCommandConfig

type IDGetCommandConfig struct {
	FlagSetName string
	Name        string
	ShortUsage  string
	ShortHelp   string
	LongHelp    string

	IDFlag  string
	IDUsage string

	ErrorPrefix string

	ContextTimeout func(context.Context) (context.Context, context.CancelFunc)
	Fetch          func(context.Context, *asc.Client, string) (any, error)
}

IDGetCommandConfig configures a standard "get by ID" command.

type IPABundleInfo

type IPABundleInfo struct {
	Version     string
	BuildNumber string
}

func ExtractBundleInfoFromIPA

func ExtractBundleInfoFromIPA(ipaPath string) (IPABundleInfo, error)

ExtractBundleInfoFromIPA reads CFBundleVersion info from an IPA.

type JUnitReport

type JUnitReport struct {
	Tests     []JUnitTestCase // Test cases in this report
	Timestamp time.Time       // Report generation time
	Name      string          // Test suite name (default: "asc")
}

JUnitReport represents a JUnit XML test report.

func (*JUnitReport) Marshal

func (r *JUnitReport) Marshal() ([]byte, error)

Marshal marshals the JUnit report to XML. Note: xml.Encoder handles escaping automatically, so we don't pre-escape.

func (*JUnitReport) Write

func (r *JUnitReport) Write(path string) error

Write writes the JUnit report to the specified file path.

func (*JUnitReport) WriteTo

func (r *JUnitReport) WriteTo(w io.Writer) (int64, error)

WriteTo writes the JUnit report to the specified writer.

type JUnitTestCase

type JUnitTestCase struct {
	Name      string        // Test name (e.g., build-123)
	Classname string        // Test class/category (e.g., builds)
	Time      time.Duration // Test duration
	Failure   string        // Failure type (empty if passed)
	Message   string        // Failure message
	SystemOut string        // Standard output
	SystemErr string        // Standard error
}

JUnitTestCase represents a single test case in a JUnit report.

type LatestBuildSelectionOptions added in v1.260404.0

type LatestBuildSelectionOptions struct {
	AppID                 string
	Version               string
	Platform              string
	ProcessingStateValues []string
	ExcludeExpired        bool
}

LatestBuildSelectionOptions controls how latest/next build helpers select build records and in-flight uploads.

func NormalizeLatestBuildSelectionOptions added in v1.260404.0

func NormalizeLatestBuildSelectionOptions(appID, version, platform, processingState string, excludeExpired bool) (LatestBuildSelectionOptions, error)

NormalizeLatestBuildSelectionOptions validates and normalizes the common version/platform filters shared by latest-build selection workflows.

type ListCommandConfig

type ListCommandConfig struct {
	Name              string
	ShortUsage        string
	ShortHelp         string
	LongHelp          string
	ErrorPrefix       string
	DeprecatedWarning string
	UsageFunc         func(*ffcli.Command) string
}

ListCommandConfig describes common help/output behavior for list-style CLI commands.

type MetadataOutputFlags

type MetadataOutputFlags struct {
	OutputFormat *string
	Pretty       *bool
}

MetadataOutputFlags stores pointers to metadata output-related flag values.

func BindMetadataOutputFlags

func BindMetadataOutputFlags(fs *flag.FlagSet) MetadataOutputFlags

BindMetadataOutputFlags registers --output-format and --pretty flags on the provided flagset.

type MultiStringFlag added in v1.260404.0

type MultiStringFlag []string

MultiStringFlag collects repeatable string flag values while rejecting empty entries so callers can bind it directly with flag.FlagSet.Var.

func (*MultiStringFlag) Set added in v1.260404.0

func (m *MultiStringFlag) Set(value string) error

func (*MultiStringFlag) String added in v1.260404.0

func (m *MultiStringFlag) String() string

type NextBuildNumberOptions added in v1.260404.0

type NextBuildNumberOptions struct {
	LatestBuildSelectionOptions LatestBuildSelectionOptions
	InitialBuildNumber          int
}

NextBuildNumberOptions configures next build number calculation.

type OptionalBool

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

OptionalBool tracks whether a boolean flag was explicitly set.

func (*OptionalBool) EnableBoolFlag

func (b *OptionalBool) EnableBoolFlag()

EnableBoolFlag allows bare --flag syntax for this OptionalBool instance.

func (*OptionalBool) IsBoolFlag

func (b *OptionalBool) IsBoolFlag() bool

IsBoolFlag tells the standard flag parser whether bare --flag is allowed.

func (OptionalBool) IsSet

func (b OptionalBool) IsSet() bool

func (*OptionalBool) Set

func (b *OptionalBool) Set(value string) error

func (*OptionalBool) String

func (b *OptionalBool) String() string

func (OptionalBool) Value

func (b OptionalBool) Value() bool

type OutputFlags

type OutputFlags struct {
	Output *string
	Pretty *bool
}

OutputFlags stores pointers to output-related flag values.

func BindOutputFlags

func BindOutputFlags(fs *flag.FlagSet) OutputFlags

BindOutputFlags registers --output and --pretty flags on the provided flagset.

func BindOutputFlagsWith

func BindOutputFlagsWith(fs *flag.FlagSet, flagName, defaultValue, usage string) OutputFlags

BindOutputFlagsWith registers a custom output-format flag and --pretty.

func BindOutputFlagsWithAllowed

func BindOutputFlagsWithAllowed(fs *flag.FlagSet, flagName, defaultValue, usage string, allowed ...string) OutputFlags

BindOutputFlagsWithAllowed registers a custom output-format flag and --pretty with an explicit allowed format set.

type PaginatedListCommandConfig

type PaginatedListCommandConfig struct {
	FlagSetName string
	Name        string
	ShortUsage  string
	ShortHelp   string
	LongHelp    string

	ParentFlag  string
	ParentUsage string

	LimitMax int

	ErrorPrefix string

	ContextTimeout func(context.Context) (context.Context, context.CancelFunc)
	FetchPage      func(context.Context, *asc.Client, string, int, string) (asc.PaginatedResponse, error)
}

PaginatedListCommandConfig configures a standard list command with --limit/--next/--paginate and a required parent resource ID.

type PriceFilter

type PriceFilter struct {
	Price    string
	MinPrice string
	MaxPrice string
}

PriceFilter holds parsed price filter criteria.

func (PriceFilter) HasFilter

func (pf PriceFilter) HasFilter() bool

HasFilter returns true if any price filter is set.

func (PriceFilter) MatchesPrice

func (pf PriceFilter) MatchesPrice(customerPrice string) bool

MatchesPrice returns true if the given customerPrice string passes the filter.

func (PriceFilter) Validate

func (pf PriceFilter) Validate() error

Validate checks that filter values are valid numbers and not contradictory.

type PricePointEqualizationsCommandConfig added in v1.260407.0

type PricePointEqualizationsCommandConfig struct {
	FlagSetName string
	Name        string

	ShortUsage  string
	BaseExample string
	Subject     string

	ParentFlag  string
	ParentUsage string
	LimitMax    int

	ErrorPrefix string

	ContextTimeout func(context.Context) (context.Context, context.CancelFunc)
	FetchPage      func(context.Context, *asc.Client, string, int, string) (asc.PaginatedResponse, error)
}

PricePointEqualizationsCommandConfig configures a standard equalizations list command for app, IAP, and subscription price points.

type PricingSetCommandConfig

type PricingSetCommandConfig struct {
	FlagSetName           string
	CommandName           string
	ShortUsage            string
	ShortHelp             string
	LongHelp              string
	ErrorPrefix           string
	StartDateHelp         string
	StartDateDefaultToday bool
	RequireBaseTerritory  bool
	ResolveBaseTerritory  bool
}

PricingSetCommandConfig configures pricing set commands.

type ReportedError

type ReportedError interface {
	error
	Reported() bool
}

ReportedError marks an error as already reported to the user. The main entrypoint should exit non-zero without duplicating output.

type ResolveBetaGroupsOptions

type ResolveBetaGroupsOptions struct {
	SkipInternal            bool
	IncludeSkipInternalHint bool
}

ResolveBetaGroupsOptions controls beta-group name resolution behavior.

type ResolvedAuthCredentials

type ResolvedAuthCredentials struct {
	KeyID    string
	IssuerID string
	KeyPath  string
	KeyPEM   string
	Profile  string
}

ResolvedAuthCredentials contains the concrete auth inputs selected for a command.

func ResolveAuthCredentials

func ResolveAuthCredentials(profile string) (ResolvedAuthCredentials, error)

ResolveAuthCredentials resolves the signing credentials for a command. A non-empty profile override takes precedence over root-level profile selection.

func ResolveAuthCredentialsMetadata added in v1.260328.0

func ResolveAuthCredentialsMetadata(profile string) (ResolvedAuthCredentials, error)

ResolveAuthCredentialsMetadata resolves the selected auth profile's key metadata without loading private key material from keychain or disk.

type ResolvedBetaGroup

type ResolvedBetaGroup struct {
	ID                   string
	Name                 string
	IsInternalGroup      bool
	HasAccessToAllBuilds bool
}

ResolvedBetaGroup captures the canonical ID and metadata for a beta group.

func ResolveBetaGroups

func ResolveBetaGroups(ctx context.Context, client betaGroupsClient, appID string, groups []string, opts ResolveBetaGroupsOptions) ([]ResolvedBetaGroup, error)

ResolveBetaGroups lists an app's beta groups and resolves the provided IDs or names.

func ResolveBetaGroupsFromList

func ResolveBetaGroupsFromList(inputGroups []string, groups *asc.BetaGroupsResponse, opts ResolveBetaGroupsOptions) ([]ResolvedBetaGroup, error)

ResolveBetaGroupsFromList resolves IDs or names against a provided beta-groups payload.

func (ResolvedBetaGroup) NameForDisplay

func (g ResolvedBetaGroup) NameForDisplay() string

type ResolvedPriceRow added in v1.260331.0

type ResolvedPriceRow struct {
	Territory     string `json:"territory"`
	PriceID       string `json:"priceId"`
	PricePointID  string `json:"pricePointId"`
	CustomerPrice string `json:"customerPrice,omitempty"`
	Currency      string `json:"currency,omitempty"`
	Proceeds      string `json:"proceeds,omitempty"`
	ProceedsYear2 string `json:"proceedsYear2,omitempty"`
	StartDate     string `json:"startDate,omitempty"`
	EndDate       string `json:"endDate,omitempty"`
	Manual        *bool  `json:"manual,omitempty"`
	Preserved     *bool  `json:"preserved,omitempty"`
}

ResolvedPriceRow represents the currently effective price for a territory.

type ResolvedPricesResult added in v1.260331.0

type ResolvedPricesResult struct {
	Prices []ResolvedPriceRow `json:"prices"`
}

ResolvedPricesResult is the command-local response envelope for --resolved pricing.

type SubmitReadinessCreateWarning added in v1.260407.0

type SubmitReadinessCreateWarning struct {
	Locale        string
	Mode          string
	MissingFields []string
}

SubmitReadinessCreateWarning describes create-scope submission risk for one locale.

func NormalizeSubmitReadinessCreateWarnings added in v1.260407.0

func NormalizeSubmitReadinessCreateWarnings(warnings []SubmitReadinessCreateWarning) []SubmitReadinessCreateWarning

NormalizeSubmitReadinessCreateWarnings sorts and dedupes warnings so callers can emit them deterministically after their main output succeeds.

func SubmitReadinessCreateWarningForLocale added in v1.260407.0

func SubmitReadinessCreateWarningForLocale(locale string, attrs asc.AppStoreVersionLocalizationAttributes, mode string) (SubmitReadinessCreateWarning, bool)

SubmitReadinessCreateWarningForLocale returns a create warning when the provided attributes would leave the locale incomplete for submission.

func SubmitReadinessCreateWarningForLocaleWithOptions added in v1.260407.0

func SubmitReadinessCreateWarningForLocaleWithOptions(locale string, attrs asc.AppStoreVersionLocalizationAttributes, mode string, opts SubmitReadinessOptions) (SubmitReadinessCreateWarning, bool)

SubmitReadinessCreateWarningForLocaleWithOptions returns a create warning when the provided attributes would leave the locale incomplete for submission.

func UploadPrevalidatedVersionLocalizationsWithWarnings added in v1.260407.0

func UploadPrevalidatedVersionLocalizationsWithWarnings(ctx context.Context, client versionLocalizationClient, versionID string, valuesByLocale map[string]map[string]string, dryRun bool, submitOpts SubmitReadinessOptions) ([]asc.LocalizationUploadLocaleResult, []SubmitReadinessCreateWarning, error)

UploadPrevalidatedVersionLocalizationsWithWarnings uploads version localizations after the caller has already validated the input value set.

func UploadVersionLocalizationsWithWarnings added in v1.260407.0

func UploadVersionLocalizationsWithWarnings(ctx context.Context, client versionLocalizationClient, versionID string, valuesByLocale map[string]map[string]string, dryRun bool, submitOpts SubmitReadinessOptions) ([]asc.LocalizationUploadLocaleResult, []SubmitReadinessCreateWarning, error)

type SubmitReadinessIssue

type SubmitReadinessIssue struct {
	Locale        string
	MissingFields []string
}

SubmitReadinessIssue describes submission-blocking missing fields for a locale.

func SubmitReadinessIssuesByLocale

func SubmitReadinessIssuesByLocale(localizations []asc.Resource[asc.AppStoreVersionLocalizationAttributes]) []SubmitReadinessIssue

SubmitReadinessIssuesByLocale evaluates all localizations and returns per-locale missing submit-required fields.

func SubmitReadinessIssuesByLocaleWithOptions

func SubmitReadinessIssuesByLocaleWithOptions(localizations []asc.Resource[asc.AppStoreVersionLocalizationAttributes], opts SubmitReadinessOptions) []SubmitReadinessIssue

SubmitReadinessIssuesByLocaleWithOptions evaluates all localizations with configurable checks and returns per-locale missing submit-required fields.

type SubmitReadinessOptions

type SubmitReadinessOptions struct {
	// RequireWhatsNew enables whatsNew validation. This should be set for
	// app updates (when a READY_FOR_SALE version already exists) because
	// App Store Connect requires whatsNew for every locale on updates.
	RequireWhatsNew bool
}

SubmitReadinessOptions controls optional submit-readiness checks.

func ResolveSubmitReadinessOptionsForVersion added in v1.260407.0

func ResolveSubmitReadinessOptionsForVersion(ctx context.Context, client *asc.Client, versionID, appID, platform string) (SubmitReadinessOptions, error)

ResolveSubmitReadinessOptionsForVersion resolves create-warning options for a version-localization workflow. Callers that only need advisory warnings should prefer the best-effort wrapper so auxiliary fetch failures do not block the primary mutation.

func ResolveSubmitReadinessOptionsForVersionBestEffort added in v1.260407.0

func ResolveSubmitReadinessOptionsForVersionBestEffort(ctx context.Context, client *asc.Client, versionID, appID, platform string) SubmitReadinessOptions

ResolveSubmitReadinessOptionsForVersionBestEffort resolves create-warning options without failing the caller when advisory context fetches fail.

type TierEntry

type TierEntry struct {
	Tier          int    `json:"tier"`
	PricePointID  string `json:"pricePointId"`
	CustomerPrice string `json:"customerPrice"`
	Proceeds      string `json:"proceeds"`
}

TierEntry represents a single tier in a territory's price point list.

func LoadTierCache

func LoadTierCache(appID, territory string) ([]TierEntry, error)

LoadTierCache loads cached tier data. Returns an error if the cache is missing or expired.

func ResolveIAPTiers

func ResolveIAPTiers(ctx context.Context, client *asc.Client, iapID, territory string, refresh bool) ([]TierEntry, error)

ResolveIAPTiers resolves in-app purchase price point tiers for an IAP and territory.

func ResolveSubscriptionTiers

func ResolveSubscriptionTiers(ctx context.Context, client *asc.Client, subscriptionID, territory string, refresh bool) ([]TierEntry, error)

ResolveSubscriptionTiers resolves subscription price point tiers for a subscription and territory.

func ResolveTiers

func ResolveTiers(ctx context.Context, client *asc.Client, appID, territory string, refresh bool) ([]TierEntry, error)

ResolveTiers fetches all price points for a territory, sorts by customerPrice ascending, and assigns tier numbers starting at 1. Free (0.00) price points are excluded.

type VersionMetadataCopyOptions

type VersionMetadataCopyOptions struct {
	AppID                string
	Platform             string
	SourceVersion        string
	DestinationVersionID string
	SelectedFields       []string
	DryRun               bool
}

VersionMetadataCopyOptions defines a metadata carry-forward operation between App Store versions.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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