appstore

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: MIT Imports: 21 Imported by: 1

Documentation

Index

Constants

View Source
const (
	FailureTypeInvalidCredentials     = "-5000"
	FailureTypePasswordTokenExpired   = "2034"
	FailureTypeLicenseNotFound        = "9610"
	FailureTypeTemporarilyUnavailable = "2059"

	CustomerMessageBadLogin             = "MZFinance.BadLogin.Configurator_message"
	CustomerMessageAccountDisabled      = "Your account is disabled."
	CustomerMessageSubscriptionRequired = "Subscription Required"

	PrivateInitDomain = "init." + iTunesAPIDomain
	PrivateInitPath   = "/bag.xml"

	PrivateAppStoreAPIDomain       = "buy." + iTunesAPIDomain
	PrivateAppStoreAPIPathPurchase = "/WebObjects/MZFinance.woa/wa/buyProduct"
	PrivateAppStoreAPIPathDownload = "/WebObjects/MZFinance.woa/wa/volumeStoreDownloadProduct"

	HTTPHeaderStoreFront = "X-Set-Apple-Store-Front"
	HTTPHeaderPod        = "pod"

	PricingParameterAppStore    = "STDQ"
	PricingParameterAppleArcade = "GAME"
)

Variables

View Source
var (
	ErrPasswordTokenExpired   = errors.New("password token is expired")
	ErrSubscriptionRequired   = errors.New("subscription required")
	ErrTemporarilyUnavailable = errors.New("item is temporarily unavailable")
)
View Source
var (
	ErrAuthCodeRequired = errors.New("auth code is required")
)
View Source
var (
	ErrLicenseRequired = errors.New("license is required")
)

Functions

This section is empty.

Types

type Account

type Account struct {
	Email               string `json:"email,omitempty"`
	PasswordToken       string `json:"passwordToken,omitempty"`
	DirectoryServicesID string `json:"directoryServicesIdentifier,omitempty"`
	Name                string `json:"name,omitempty"`
	StoreFront          string `json:"storeFront,omitempty"`
	Password            string `json:"password,omitempty"`
	Pod                 string `json:"pod,omitempty"`
}

type AccountInfoOutput

type AccountInfoOutput struct {
	Account Account
}

type App

type App struct {
	ID       int64   `json:"trackId,omitempty"`
	BundleID string  `json:"bundleId,omitempty"`
	Name     string  `json:"trackName,omitempty"`
	Version  string  `json:"version,omitempty"`
	Price    float64 `json:"price,omitempty"`
}

func (App) MarshalZerologObject

func (a App) MarshalZerologObject(event *zerolog.Event)

type AppStore

type AppStore interface {
	// Login authenticates with the App Store.
	Login(input LoginInput) (LoginOutput, error)
	// AccountInfo returns the information of the authenticated account.
	AccountInfo() (AccountInfoOutput, error)
	// Revoke revokes the active credentials.
	Revoke() error
	// Lookup looks apps up based on the specified bundle identifier.
	Lookup(input LookupInput) (LookupOutput, error)
	// Search searches the App Store for apps matching the specified term.
	Search(input SearchInput) (SearchOutput, error)
	// Purchase acquires a license for the desired app.
	// Note: only free apps are supported.
	Purchase(input PurchaseInput) error
	// Download downloads the IPA package from the App Store to the desired location.
	Download(input DownloadInput) (DownloadOutput, error)
	// ReplicateSinf replicates the sinf for the IPA package.
	ReplicateSinf(input ReplicateSinfInput) error
	// VersionHistory lists the available versions of the specified app.
	ListVersions(input ListVersionsInput) (ListVersionsOutput, error)
	// GetVersionMetadata returns the metadata for the specified version.
	GetVersionMetadata(input GetVersionMetadataInput) (GetVersionMetadataOutput, error)
	// Bag fetches the bag which contains endpoint definitions.
	Bag(input BagInput) (BagOutput, error)
}

func NewAppStore

func NewAppStore(args Args) AppStore

type Apps

type Apps []App

func (Apps) MarshalZerologArray

func (apps Apps) MarshalZerologArray(a *zerolog.Array)

type Args

type Args struct {
	Keychain        keychain.Keychain
	CookieJar       http.CookieJar
	OperatingSystem operatingsystem.OperatingSystem
	Machine         machine.Machine
}

type BagInput added in v2.3.0

type BagInput struct{}

type BagOutput added in v2.3.0

type BagOutput struct {
	AuthEndpoint string
}

type DownloadInput

type DownloadInput struct {
	Account           Account
	App               App
	OutputPath        string
	Progress          *progressbar.ProgressBar
	ExternalVersionID string
}

type DownloadOutput

type DownloadOutput struct {
	DestinationPath string
	Sinfs           []Sinf
}

type Error

type Error struct {
	Metadata interface{}
	// contains filtered or unexported fields
}

func NewErrorWithMetadata

func NewErrorWithMetadata(err error, metadata interface{}) *Error

func (Error) Error

func (t Error) Error() string

type GetVersionMetadataInput added in v2.2.0

type GetVersionMetadataInput struct {
	Account   Account
	App       App
	VersionID string
}

type GetVersionMetadataOutput added in v2.2.0

type GetVersionMetadataOutput struct {
	DisplayVersion string
	ReleaseDate    time.Time
}

type ListVersionsInput added in v2.2.0

type ListVersionsInput struct {
	Account Account
	App     App
}

type ListVersionsOutput added in v2.2.0

type ListVersionsOutput struct {
	ExternalVersionIdentifiers []string
	LatestExternalVersionID    string
}

type LoginInput

type LoginInput struct {
	Email    string
	Password string
	AuthCode string
	Endpoint string
}

type LoginOutput

type LoginOutput struct {
	Account Account
}

type LookupInput

type LookupInput struct {
	Account  Account
	BundleID string
}

type LookupOutput

type LookupOutput struct {
	App App
}

type PurchaseInput

type PurchaseInput struct {
	Account Account
	App     App
}

type ReplicateSinfInput

type ReplicateSinfInput struct {
	Sinfs       []Sinf
	PackagePath string
}

type SearchInput

type SearchInput struct {
	Account Account
	Term    string
	Limit   int64
}

type SearchOutput

type SearchOutput struct {
	Count   int
	Results []App
}

type Sinf

type Sinf struct {
	ID   int64  `plist:"id,omitempty"`
	Data []byte `plist:"sinf,omitempty"`
}

type VersionDetails added in v2.2.0

type VersionDetails struct {
	VersionID     string
	VersionString string
	Success       bool
	Error         string
}

type VersionHistoryInfo added in v2.2.0

type VersionHistoryInfo struct {
	App                App
	LatestVersion      string
	VersionIdentifiers []string
}

Jump to

Keyboard shortcuts

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