appleconnect

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidCredentials = errors.New("incorrect Apple Account email or password")
	ErrAccountAction      = errors.New("complete the pending Apple Account prompt in a browser and try again")
)

Functions

This section is empty.

Types

type Challenge

type Challenge struct {
	Method      string `json:"method"`
	Destination string `json:"destination,omitempty"`
	CodeLength  int    `json:"code_length"`
}

type Client

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

func New

func New(opts Options) (*Client, error)

func (*Client) AppExists

func (c *Client) AppExists(ctx context.Context, session *Session, bundleID string) (bool, error)

AppExists reports whether an App Store Connect app record exists for the bundle ID on the selected team.

func (*Client) CheckKeyAccess

func (c *Client) CheckKeyAccess(ctx context.Context, session *Session, kind KeyKind) error

func (*Client) CompleteTwoFactor

func (c *Client) CompleteTwoFactor(ctx context.Context, session *Session, code string) error

func (*Client) CreateApp

func (c *Client) CreateApp(ctx context.Context, session *Session, name, bundleID, sku string) error

CreateApp creates the App Store Connect app record via the modern iris API, mirroring Spaceship's ConnectAPI::Tunes#post_app: one JSON:API graph of app, appInfo, localizations, and an initial iOS version, wired together with ${placeholder} IDs the server resolves.

func (*Client) CreateAppStoreConnectKey

func (c *Client) CreateAppStoreConnectKey(ctx context.Context, session *Session, name string) (*Key, error)

func (*Client) CreateInAppPurchaseKey

func (c *Client) CreateInAppPurchaseKey(ctx context.Context, session *Session, name string) (*Key, error)

func (*Client) FetchVendorNumber

func (c *Client) FetchVendorNumber(ctx context.Context, session *Session) (string, error)

FetchVendorNumber returns the provider's sales-report vendor number using the internal endpoint behind the App Store Connect payments page (the same place the docs tell users to copy it from manually). Best-effort: callers should fall back to asking the user when this errors.

func (*Client) Login

func (c *Client) Login(ctx context.Context, email, password string) (*Session, error)

func (*Client) PrepareTwoFactor

func (c *Client) PrepareTwoFactor(ctx context.Context, session *Session, useSMS bool, phoneNumber string) (*Challenge, error)

func (*Client) RegisterBundleID

func (c *Client) RegisterBundleID(ctx context.Context, session *Session, identifier, name string) error

RegisterBundleID registers an explicit iOS bundle ID in the Developer Portal via the modern provisioning API. An already-registered identifier is not an error.

func (*Client) SelectProvider

func (c *Client) SelectProvider(ctx context.Context, session *Session, providerID int64) error

type Key

type Key struct {
	Kind       KeyKind `json:"kind"`
	ID         string  `json:"id"`
	IssuerID   string  `json:"issuer_id"`
	PrivateKey string  `json:"-"`
}

type KeyKind

type KeyKind string
const (
	AppStoreConnectKey KeyKind = "app_store_connect"
	InAppPurchaseKey   KeyKind = "in_app_purchase"
)

type Options

type Options struct {
	HTTPClient  *http.Client
	AuthBaseURL string
	ASCBaseURL  string
}

type Provider

type Provider struct {
	ID       int64  `json:"provider_id"`
	PublicID string `json:"public_provider_id,omitempty"`
	Name     string `json:"name"`
}

type Session

type Session struct {
	ServiceKey       string
	AppleIDSessionID string
	SCNT             string
	Email            string
	Provider         Provider
	Providers        []Provider
	// contains filtered or unexported fields
}

type TwoFactorRequiredError

type TwoFactorRequiredError struct{}

func (*TwoFactorRequiredError) Error

func (*TwoFactorRequiredError) Error() string

Jump to

Keyboard shortcuts

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