appstore

package
v1.1.5-0...-67e557e Latest Latest
Warning

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

Go to latest
Published: May 27, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

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

	CustomerMessageBadLogin             = "MZFinance.BadLogin.Configurator_message"
	CustomerMessageSubscriptionRequired = "Subscription Required"

	PrivateAppStoreAPIDomainPrefixWithoutAuthCode = "p25"
	PrivateAppStoreAPIDomainPrefixWithAuthCode    = "p71"
	PrivateAppStoreAPIDomain                      = "buy." + iTunesAPIDomain
	PrivateAppStoreAPIPathAuthenticate            = "/WebObjects/MZFinance.woa/wa/authenticate"
	PrivateAppStoreAPIPathPurchase                = "/WebObjects/MZBuy.woa/wa/buyProduct"
	PrivateAppStoreAPIPathDownload                = "/WebObjects/MZFinance.woa/wa/volumeStoreDownloadProduct"

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

	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"`
}

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
}

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 DownloadInput

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

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 LoginInput

type LoginInput struct {
	Email    string
	Password string
	AuthCode 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"`
}

Jump to

Keyboard shortcuts

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