appstore

package module
v0.0.0-...-57b743d Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: MIT Imports: 12 Imported by: 0

README

App Store Connect API

CI

Unofficial App Store Connect API client for Go.

Please note, it may not be fully functional or up-to-date. If you have any issues, please open an issue or submit a pull request.

Requirements

  • Go 1.22.x

Installation

go get -u github.com/alexprogrammr/appstore-go

Resources

License

Licensed under The MIT License, see LICENSE.

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Achievement

type Achievement struct {
	ReferenceName    string `json:"referenceName"`
	VendorIdentifier string `json:"vendorIdentifier"`
	Points           int    `json:"points"`
	Repeatable       bool   `json:"repeatable"`
	ShowBeforeEarned bool   `json:"showBeforeEarned"`
}

https://developer.apple.com/documentation/appstoreconnectapi/gamecenterachievement/attributes

type AchievementLocalization

type AchievementLocalization struct {
	Locale                  Locale `json:"locale"`
	Name                    string `json:"name"`
	BeforeEarnedDescription string `json:"beforeEarnedDescription"`
	AfterEarnedDescription  string `json:"afterEarnedDescription"`
}

https://developer.apple.com/documentation/appstoreconnectapi/gamecenterachievementlocalization/attributes

type AchievementLocalizationUpdate

type AchievementLocalizationUpdate struct {
	ID                      string `json:"-"`
	Name                    string `json:"name,omitempty"`
	BeforeEarnedDescription string `json:"beforeEarnedDescription,omitempty"`
	AfterEarnedDescription  string `json:"afterEarnedDescription,omitempty"`
}

type AchievementUpdate

type AchievementUpdate struct {
	ID               string `json:"-"`
	ReferenceName    string `json:"referenceName,omitempty"`
	Points           int    `json:"points,omitempty"`
	Repeatable       bool   `json:"repeatable,omitempty"`
	ShowBeforeEarned bool   `json:"showBeforeEarned,omitempty"`
}

type App

type App struct {
	Name          string `json:"name"`
	BundleID      string `json:"bundleId"`
	SKU           string `json:"sku"`
	PrimaryLocale Locale `json:"primaryLocale"`
}

https://developer.apple.com/documentation/appstoreconnectapi/app/attributes

type AppEvent

type AppEvent struct {
	ReferenceName string `json:"referenceName"`
	PrimaryLocale Locale `json:"primaryLocale"`
}

https://developer.apple.com/documentation/appstoreconnectapi/appevent/attributes-data.dictionary

type AppEventLocalization

type AppEventLocalization struct {
	Locale           Locale `json:"locale"`
	Name             string `json:"name"`
	ShortDescription string `json:"shortDescription"`
	LongDescription  string `json:"longDescription"`
}

https://developer.apple.com/documentation/appstoreconnectapi/appeventlocalizationcreaterequest/data-data.dictionary/attributes-data.dictionary

type AppScreenshotSet

type AppScreenshotSet struct {
	DisplayType DisplayType `json:"screenshotDisplayType"`
}

type AppVersion

type AppVersion struct {
	Platform        string    `json:"platform"`
	AppStoreState   string    `json:"appStoreState"`
	AppVersionState string    `json:"appVersionState"`
	Version         string    `json:"versionString"`
	Copyright       string    `json:"copyright"`
	Downloadable    bool      `json:"downloadable"`
	CreatedDate     time.Time `json:"createdDate"`
	ReleaseDate     time.Time `json:"earliestReleaseDate"`
	ReleaseType     string    `json:"releaseType"`
	ReviewType      string    `json:"reviewType"`
}

type AppVersionLocalization

type AppVersionLocalization struct {
	Locale       Locale `json:"locale"`
	WhatsNew     string `json:"whatsNew"`
	Description  string `json:"description"`
	Promotional  string `json:"promotionalText"`
	Keywords     string `json:"keywords"`
	MarketingURL string `json:"marketingUrl"`
	SupportURL   string `json:"supportUrl"`
}

type AppVersionLocalizationUpdate

type AppVersionLocalizationUpdate struct {
	ID           string `json:"-"`
	WhatsNew     string `json:"whatsNew,omitempty"`
	Description  string `json:"description,omitempty"`
	Promotional  string `json:"promotionalText,omitempty"`
	Keywords     string `json:"keywords,omitempty"`
	MarketingURL string `json:"marketingUrl,omitempty"`
	SupportURL   string `json:"supportUrl,omitempty"`
}

type Asset

type Asset struct {
	Name       string             `json:"fileName"`
	Size       int                `json:"fileSize"`
	State      AssetDeliveryState `json:"assetDeliveryState"`
	Image      ImageAsset         `json:"imageAsset"`
	Operations []UploadOperation  `json:"uploadOperations"`
}

type AssetDeliveryState

type AssetDeliveryState struct {
	State    AssetState        `json:"state"`
	Errors   []AssetStateError `json:"errors"`
	Warnings []AssetStateError `json:"warnings"`
}

func (AssetDeliveryState) Error

func (s AssetDeliveryState) Error() error

func (AssetDeliveryState) IsComplete

func (s AssetDeliveryState) IsComplete() bool

type AssetState

type AssetState string
const (
	AssetStateReadyForUpload AssetState = "AWAITING_UPLOAD"
	AssetStateUploadComplete AssetState = "UPLOAD_COMPLETE"
	AssetStateComplete       AssetState = "COMPLETE"
	AssetStateFailed         AssetState = "FAILED"
)

type AssetStateError

type AssetStateError struct {
	Code        string `json:"code"`
	Description string `json:"description"`
}

type Client

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

func NewClient

func NewClient(httpClient HTTPClient, tokenSource TokenSource) *Client

func (*Client) CreateAppEventLocalization

func (c *Client) CreateAppEventLocalization(ctx context.Context, event *Resource[AppEvent], loc *AppEventLocalization) (*Resource[AppEventLocalization], error)

func (*Client) CreateAppScreenshot

func (c *Client) CreateAppScreenshot(ctx context.Context, set *Resource[AppScreenshotSet], name string, data []byte) (*Resource[Asset], error)

func (*Client) DeleteAchievementByID

func (c *Client) DeleteAchievementByID(ctx context.Context, id string) error

func (*Client) DeleteAchievementImageByID

func (c *Client) DeleteAchievementImageByID(ctx context.Context, id string) error

func (*Client) DeleteAchievementLocalizationByID

func (c *Client) DeleteAchievementLocalizationByID(ctx context.Context, id string) error

func (*Client) GetAchievementImageByID

func (c *Client) GetAchievementImageByID(ctx context.Context, id string) (*Resource[Asset], error)

func (*Client) GetGameCenterByID

func (c *Client) GetGameCenterByID(ctx context.Context, id string) (*Resource[GameCenter], error)

type Config

type Config struct {
	KeyID       string
	IssuerID    string
	PrivateKey  []byte
	ExpireAfter time.Duration
}

type DisplayType

type DisplayType string
const (
	DisplayTypeAppIPhone67               DisplayType = "APP_IPHONE_67"
	DisplayTypeAppIPhone65               DisplayType = "APP_IPHONE_65"
	DisplayTypeAppIPhone61               DisplayType = "APP_IPHONE_61"
	DisplayTypeAppIPhone58               DisplayType = "APP_IPHONE_58"
	DisplayTypeAppIPhone55               DisplayType = "APP_IPHONE_55"
	DisplayTypeAppIPhone47               DisplayType = "APP_IPHONE_47"
	DisplayTypeAppIPhone40               DisplayType = "APP_IPHONE_40"
	DisplayTypeAppIPhone35               DisplayType = "APP_IPHONE_35"
	DisplayTypeAppIPadPro3Gen129         DisplayType = "APP_IPAD_PRO_3GEN_129"
	DisplayTypeAppIPadPro3Gen11          DisplayType = "APP_IPAD_PRO_3GEN_11"
	DisplayTypeAppIPadPro129             DisplayType = "APP_IPAD_PRO_129"
	DisplayTypeAppIPad105                DisplayType = "APP_IPAD_105"
	DisplayTypeAppIPad97                 DisplayType = "APP_IPAD_97"
	DisplayTypeAppWatchUltra             DisplayType = "APP_WATCH_ULTRA"
	DisplayTypeAppWatchSeries7           DisplayType = "APP_WATCH_SERIES_7"
	DisplayTypeAppWatchSeries4           DisplayType = "APP_WATCH_SERIES_4"
	DisplayTypeAppWatchSeries3           DisplayType = "APP_WATCH_SERIES_3"
	DisplayTypeAppDesktop                DisplayType = "APP_DESKTOP"
	DisplayTypeAppAppleTV                DisplayType = "APP_APPLE_TV"
	DisplayTypeIMessageAppIPhone67       DisplayType = "IMESSAGE_APP_IPHONE_67"
	DisplayTypeIMessageAppIPhone65       DisplayType = "IMESSAGE_APP_IPHONE_65"
	DisplayTypeIMessageAppIPhone61       DisplayType = "IMESSAGE_APP_IPHONE_61"
	DisplayTypeIMessageAppIPhone58       DisplayType = "IMESSAGE_APP_IPHONE_58"
	DisplayTypeIMessageAppIPhone55       DisplayType = "IMESSAGE_APP_IPHONE_55"
	DisplayTypeIMessageAppIPhone47       DisplayType = "IMESSAGE_APP_IPHONE_47"
	DisplayTypeIMessageAppIPhone40       DisplayType = "IMESSAGE_APP_IPHONE_40"
	DisplayTypeIMessageAppIPadPro3Gen129 DisplayType = "IMESSAGE_APP_IPAD_PRO_3GEN_129"
	DisplayTypeIMessageAppIPadPro3Gen11  DisplayType = "IMESSAGE_APP_IPAD_PRO_3GEN_11"
	DisplayTypeIMessageAppIPadPro129     DisplayType = "IMESSAGE_APP_IPAD_PRO_129"
	DisplayTypeIMessageAppIPad105        DisplayType = "IMESSAGE_APP_IPAD_105"
	DisplayTypeIMessageAppIPad97         DisplayType = "IMESSAGE_APP_IPAD_97"
	DisplayTypeAppAppleVisionPro         DisplayType = "APP_APPLE_VISION_PRO"
)

type GameCenter

type GameCenter struct {
	ArcadeEnabled    bool `json:"arcadeEnabled"`
	ChallengeEnabled bool `json:"challengeEnabled"`
}

https://developer.apple.com/documentation/appstoreconnectapi/gamecenterdetail/attributes

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

type HttpHeader

type HttpHeader struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type ImageAsset

type ImageAsset struct {
	TemplateURL string `json:"templateUrl"`
	Width       int    `json:"width"`
	Height      int    `json:"height"`
}
type Links struct {
	Self  string `json:"self"`
	Next  string `json:"next"`
	First string `json:"first"`
}

type Locale

type Locale string
const (
	LocaleArabic             Locale = "ar-SA"
	LocaleCatalan            Locale = "ca"
	LocaleChineseSimplified  Locale = "zh-Hans"
	LocaleChineseTraditional Locale = "zh-Hant"
	LocaleCroatian           Locale = "hr"
	LocaleCzech              Locale = "cs"
	LocaleDanish             Locale = "da"
	LocaleDutch              Locale = "nl-NL"
	LocaleEnglishAustralia   Locale = "en-AU"
	LocaleEnglishCanada      Locale = "en-CA"
	LocaleEnglishUK          Locale = "en-GB"
	LocaleEnglishUS          Locale = "en-US"
	LocaleFinnish            Locale = "fi"
	LocaleFrench             Locale = "fr-FR"
	LocaleFrenchCanada       Locale = "fr-CA"
	LocaleGerman             Locale = "de-DE"
	LocaleGreek              Locale = "el"
	LocaleHebrew             Locale = "he"
	LocaleHindi              Locale = "hi"
	LocaleHungarian          Locale = "hu"
	LocaleIndonesian         Locale = "id"
	LocaleItalian            Locale = "it"
	LocaleJapanese           Locale = "ja"
	LocaleKorean             Locale = "ko"
	LocaleMalay              Locale = "ms"
	LocaleNorwegian          Locale = "nb"
	LocalePolish             Locale = "pl"
	LocalePortugueseBrazil   Locale = "pt-BR"
	LocalePortuguesePortugal Locale = "pt-PT"
	LocaleRomanian           Locale = "ro"
	LocaleRussian            Locale = "ru"
	LocaleSlovak             Locale = "sk"
	LocaleSpanishMexico      Locale = "es-MX"
	LocaleSpanishSpain       Locale = "es-ES"
	LocaleSwedish            Locale = "sv"
	LocaleThai               Locale = "th"
	LocaleTurkish            Locale = "tr"
	LocaleUkrainian          Locale = "uk"
	LocaleVietnamese         Locale = "vi"
)

type Resource

type Resource[T any] struct {
	ID    string `json:"id"`
	Type  string `json:"type"`
	Attr  T      `json:"attributes"`
	Links Links  `json:"links"`
}

type TokenSource

type TokenSource interface {
	Token() (string, error)
}

func NewTokenSource

func NewTokenSource(config Config) (TokenSource, error)

type UploadOperation

type UploadOperation struct {
	Method  string       `json:"method"`
	URL     string       `json:"url"`
	Offset  int          `json:"offset"`
	Length  int          `json:"length"`
	Headers []HttpHeader `json:"requestHeaders"`
}

Jump to

Keyboard shortcuts

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