web

package
v1.260322.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2026 License: MIT Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAPIKeyNotFound        = errors.New("api key not found")
	ErrAPIKeyNotVisible      = errors.New("api key not visible in accessible key lists")
	ErrAPIKeyRolesUnresolved = errors.New("api key roles could not be resolved")
)
View Source
var ErrCachedSessionExpired = errors.New("cached web session expired")
View Source
var (

	// ErrInvalidAppleAccountCredentials reports rejected Apple Account
	// credentials during web login flows.
	ErrInvalidAppleAccountCredentials = errInvalidAppleAccountCredentials
)

Functions

func ApplyJSONMergePatch

func ApplyJSONMergePatch(content json.RawMessage, patch json.RawMessage) (json.RawMessage, bool, error)

ApplyJSONMergePatch applies an RFC 7396-style merge patch to workflow content. Both the existing content and the patch must be JSON objects.

func DeleteAllSessions

func DeleteAllSessions() error

DeleteAllSessions removes all cached web sessions.

func DeleteSession

func DeleteSession(username string) error

DeleteSession removes the cached session for a specific Apple ID.

func ECIESEncrypt

func ECIESEncrypt(serverKeyB64 string, plaintext string) (string, error)

ECIESEncrypt encrypts a plaintext value using the ECIES scheme used by the App Store Connect Xcode Cloud UI for secret environment variables.

Algorithm (reverse-engineered from ASC web UI JS):

  1. Decode server P-256 public key (64 bytes raw x||y), prepend 0x04
  2. Generate ephemeral ECDH P-256 key pair
  3. ECDH key agreement → 32-byte shared secret
  4. HKDF-SHA256(key=shared_secret, salt=random_32, info="") → AES-256 key
  5. AES-256-GCM(key, iv=random_12, plaintext) → ciphertext + 16-byte tag
  6. Output = salt(32) || ephemeral_pub_no_prefix(64) || iv(12) || ciphertext_with_tag
  7. Base64 encode

func IsDuplicateAppNameError

func IsDuplicateAppNameError(err error) bool

IsDuplicateAppNameError reports whether an internal API error means app name is taken.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound reports whether the internal web API returned a not-found response.

func PersistSession

func PersistSession(session *AuthSession) error

PersistSession stores web-session cookies for later reuse.

func SetEnvVars

func SetEnvVars(content json.RawMessage, vars []CIEnvironmentVariable) (json.RawMessage, error)

SetEnvVars sets environment_variables in raw workflow content, preserving other fields.

func SetWorkflowDisabled

func SetWorkflowDisabled(content json.RawMessage, disabled bool) (json.RawMessage, error)

SetWorkflowDisabled sets the disabled field on raw workflow content while preserving all other fields.

func SubmitTwoFactorCode

func SubmitTwoFactorCode(ctx context.Context, session *AuthSession, code string) error

SubmitTwoFactorCode completes a pending 2FA challenge for an existing session.

Types

type APIError

type APIError struct {
	Status         int
	AppleRequestID string
	CorrelationKey string
	// contains filtered or unexported fields
}

APIError wraps non-2xx internal web API responses.

The raw body is retained for internal classification and tests, but Error() intentionally avoids dumping response bodies that may contain sensitive data.

func (*APIError) Error

func (e *APIError) Error() string

type APIKeyRoleLookup

type APIKeyRoleLookup struct {
	KeyID       string    `json:"keyId"`
	Name        string    `json:"name,omitempty"`
	Kind        string    `json:"kind"`
	Roles       []string  `json:"roles"`
	RoleSource  string    `json:"roleSource"`
	Active      bool      `json:"active"`
	KeyType     string    `json:"keyType,omitempty"`
	LastUsed    string    `json:"lastUsed,omitempty"`
	Lookup      string    `json:"lookup"`
	GeneratedBy *KeyActor `json:"generatedBy,omitempty"`
	RevokedBy   *KeyActor `json:"revokedBy,omitempty"`
}

type AppAvailability

type AppAvailability struct {
	ID                        string   `json:"id"`
	Type                      string   `json:"type,omitempty"`
	AvailableInNewTerritories bool     `json:"availableInNewTerritories"`
	AvailableTerritories      []string `json:"availableTerritories,omitempty"`
}

AppAvailability models the internal web API app availability resource.

type AppAvailabilityCreateAttributes

type AppAvailabilityCreateAttributes struct {
	AppID                     string   `json:"-"`
	AvailableInNewTerritories bool     `json:"-"`
	AvailableTerritories      []string `json:"-"`
}

AppAvailabilityCreateAttributes defines inputs for creating initial app availability.

type AppCreateAttributes

type AppCreateAttributes struct {
	Name          string `json:"-"`
	SKU           string `json:"sku"`
	PrimaryLocale string `json:"primaryLocale"`
	BundleID      string `json:"bundleId"`
	CompanyName   string `json:"companyName,omitempty"`
	Platform      string `json:"-"`
	VersionString string `json:"-"`
}

AppCreateAttributes defines app creation inputs for the internal web API.

type AppDataUsage

type AppDataUsage struct {
	ID             string `json:"id"`
	Category       string `json:"category,omitempty"`
	Purpose        string `json:"purpose,omitempty"`
	DataProtection string `json:"dataProtection,omitempty"`
}

AppDataUsage models one appDataUsages resource.

type AppDataUsageCategory

type AppDataUsageCategory struct {
	ID       string `json:"id"`
	Deleted  bool   `json:"deleted,omitempty"`
	Grouping string `json:"grouping,omitempty"`
}

AppDataUsageCategory models one appDataUsageCategories resource.

type AppDataUsageDataProtection

type AppDataUsageDataProtection struct {
	ID      string `json:"id"`
	Deleted bool   `json:"deleted,omitempty"`
}

AppDataUsageDataProtection models one appDataUsageDataProtections resource.

type AppDataUsagePurpose

type AppDataUsagePurpose struct {
	ID      string `json:"id"`
	Deleted bool   `json:"deleted,omitempty"`
}

AppDataUsagePurpose models one appDataUsagePurposes resource.

type AppDataUsagesPublishState

type AppDataUsagesPublishState struct {
	ID        string `json:"id"`
	Published bool   `json:"published"`
}

AppDataUsagesPublishState captures publication state for app privacy data usages.

type AppResponse

type AppResponse struct {
	Data struct {
		ID         string         `json:"id"`
		Type       string         `json:"type"`
		Attributes map[string]any `json:"attributes"`
	} `json:"data"`
}

AppResponse is the app response payload from internal create/find calls.

type AppStoreVersionForReview

type AppStoreVersionForReview struct {
	ID       string `json:"id"`
	Version  string `json:"version,omitempty"`
	Platform string `json:"platform,omitempty"`
}

AppStoreVersionForReview describes app version context attached to review data.

type AuthSession

type AuthSession struct {
	Client           *http.Client
	ProviderID       int64
	PublicProviderID string
	TeamID           string
	UserEmail        string

	// Continuation state needed after a 409 SRP completion response.
	ServiceKey       string
	AppleIDSessionID string
	SCNT             string
}

AuthSession holds authenticated web-session state for internal API calls.

func LoadCachedSession

func LoadCachedSession(username string) (*AuthSession, bool, error)

LoadCachedSession loads a cached web session cookie jar without validating it against the live App Store Connect session endpoint. This is used for best-effort relogin attempts that want to preserve Apple trust cookies.

func LoadLastCachedSession

func LoadLastCachedSession() (*AuthSession, bool, error)

LoadLastCachedSession loads the last cached web session cookie jar without validating it against the live App Store Connect session endpoint.

func Login

func Login(ctx context.Context, creds LoginCredentials) (*AuthSession, error)

Login performs Apple ID SRP authentication and returns a web session.

If 2FA is required, Login returns a non-nil partial session and an error wrapping *TwoFactorRequiredError. The caller can continue with SubmitTwoFactorCode.

func LoginWithClient

func LoginWithClient(ctx context.Context, client *http.Client, creds LoginCredentials) (*AuthSession, error)

LoginWithClient performs Apple ID SRP authentication reusing an existing HTTP client and cookie jar. This is used for best-effort relogin attempts that should preserve Apple trust cookies from a cached session.

func TryResumeLastSession

func TryResumeLastSession(ctx context.Context) (*AuthSession, bool, error)

TryResumeLastSession attempts to resume the last successful web session.

func TryResumeSession

func TryResumeSession(ctx context.Context, username string) (*AuthSession, bool, error)

TryResumeSession attempts to resume a session for a specific Apple ID.

type CIDayUsage

type CIDayUsage struct {
	Date           string `json:"date"`
	Duration       int    `json:"duration"`
	NumberOfBuilds int    `json:"number_of_builds,omitempty"`
}

CIDayUsage describes usage for a single day.

func (*CIDayUsage) UnmarshalJSON

func (d *CIDayUsage) UnmarshalJSON(data []byte) error

type CIEncryptionKeyResponse

type CIEncryptionKeyResponse struct {
	Key string `json:"key"`
}

CIEncryptionKeyResponse is the response from /auth/keys/client-encryption.

type CIEnvironmentVariable

type CIEnvironmentVariable struct {
	ID    string                     `json:"id"`
	Name  string                     `json:"name"`
	Value CIEnvironmentVariableValue `json:"value"`
}

CIEnvironmentVariable represents a workflow environment variable.

func ExtractEnvVars

func ExtractEnvVars(content json.RawMessage) ([]CIEnvironmentVariable, error)

ExtractEnvVars extracts environment_variables from raw workflow content.

type CIEnvironmentVariableValue

type CIEnvironmentVariableValue struct {
	Plaintext     *string `json:"plaintext,omitempty"`
	Ciphertext    *string `json:"ciphertext,omitempty"`
	RedactedValue *string `json:"redacted_value,omitempty"`
}

CIEnvironmentVariableValue holds exactly one of plaintext, ciphertext, or redacted.

type CIMonthUsage

type CIMonthUsage struct {
	Month          int `json:"month"`
	Year           int `json:"year"`
	Duration       int `json:"duration"`
	NumberOfBuilds int `json:"number_of_builds,omitempty"`
}

CIMonthUsage describes usage for a single month.

func (*CIMonthUsage) UnmarshalJSON

func (m *CIMonthUsage) UnmarshalJSON(data []byte) error

type CIProduct

type CIProduct struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	BundleID string `json:"bundle_id"`
	Type     string `json:"type"`
	IconURL  string `json:"icon_url,omitempty"`
}

CIProduct describes a Xcode Cloud product.

type CIProductEnvVarRequest

type CIProductEnvVarRequest struct {
	Name        string                     `json:"name"`
	Value       CIEnvironmentVariableValue `json:"value"`
	IsLocked    bool                       `json:"is_locked"`
	WorkflowIDs []string                   `json:"workflow_ids"`
}

CIProductEnvVarRequest is the PUT body for creating/updating a shared env var.

type CIProductEnvironmentVariable

type CIProductEnvironmentVariable struct {
	ID                       string                     `json:"id"`
	Name                     string                     `json:"name"`
	Value                    CIEnvironmentVariableValue `json:"value"`
	IsLocked                 bool                       `json:"is_locked"`
	RelatedWorkflowSummaries []CIRelatedWorkflowSummary `json:"related_workflow_summaries,omitempty"`
}

CIProductEnvironmentVariable represents a shared (product-level) environment variable.

type CIProductListResponse

type CIProductListResponse struct {
	Items []CIProduct `json:"items"`
}

CIProductListResponse is the response from the products endpoint.

type CIProductUsage

type CIProductUsage struct {
	ProductID              string         `json:"product_id"`
	ProductName            string         `json:"product_name,omitempty"`
	BundleID               string         `json:"bundle_id,omitempty"`
	Usage                  []CIMonthUsage `json:"usage,omitempty"`
	UsageInMinutes         int            `json:"usage_in_minutes,omitempty"`
	UsageInSeconds         int            `json:"usage_in_seconds,omitempty"`
	NumberOfBuilds         int            `json:"number_of_builds,omitempty"`
	PreviousUsageInMinutes int            `json:"previous_usage_in_minutes,omitempty"`
	PreviousNumberOfBuilds int            `json:"previous_number_of_builds,omitempty"`
}

CIProductUsage describes per-product monthly usage.

type CIRelatedWorkflowSummary

type CIRelatedWorkflowSummary struct {
	ID             string `json:"id"`
	Name           string `json:"name"`
	Disabled       bool   `json:"disabled"`
	Locked         bool   `json:"locked"`
	LastModifiedBy string `json:"last_modified_by,omitempty"`
	LastModifiedAt string `json:"last_modified_at,omitempty"`
}

CIRelatedWorkflowSummary describes a workflow linked to a shared env var.

type CIUsageDays

type CIUsageDays struct {
	Usage         []CIDayUsage      `json:"usage"`
	ProductUsage  []CIProductUsage  `json:"product_usage,omitempty"`
	WorkflowUsage []CIWorkflowUsage `json:"workflow_usage"`
	Info          CIUsageInfo       `json:"info"`
}

CIUsageDays is the response from the daily usage endpoint.

type CIUsageInfo

type CIUsageInfo struct {
	StartMonth         int                `json:"start_month,omitempty"`
	StartYear          int                `json:"start_year,omitempty"`
	EndMonth           int                `json:"end_month,omitempty"`
	EndYear            int                `json:"end_year,omitempty"`
	CanViewAllProducts bool               `json:"can_view_all_products,omitempty"`
	Current            CIUsageInfoCurrent `json:"current,omitempty"`
	Previous           CIUsageInfoCurrent `json:"previous,omitempty"`
	Links              map[string]string  `json:"links,omitempty"`
}

CIUsageInfo holds metadata about the usage response.

type CIUsageInfoCurrent

type CIUsageInfoCurrent struct {
	Builds        int `json:"builds"`
	Used          int `json:"used"`
	Average30Days int `json:"average_30_days"`
}

CIUsageInfoCurrent summarizes usage in the current/previous period.

type CIUsageMonths

type CIUsageMonths struct {
	Usage        []CIMonthUsage   `json:"usage"`
	ProductUsage []CIProductUsage `json:"product_usage"`
	Info         CIUsageInfo      `json:"info"`
}

CIUsageMonths is the response from the monthly usage endpoint.

type CIUsagePlan

type CIUsagePlan struct {
	Name          string `json:"name"`
	ResetDate     string `json:"reset_date"`
	ResetDateTime string `json:"reset_date_time"`
	Available     int    `json:"available"`
	Used          int    `json:"used"`
	Total         int    `json:"total"`
}

CIUsagePlan describes the Xcode Cloud plan quota.

type CIUsageSummary

type CIUsageSummary struct {
	Plan  CIUsagePlan       `json:"plan"`
	Links map[string]string `json:"links,omitempty"`
}

CIUsageSummary is the response from the usage summary endpoint.

type CIWorkflow

type CIWorkflow struct {
	ID      string            `json:"id"`
	Content CIWorkflowContent `json:"content"`
}

CIWorkflow describes a Xcode Cloud workflow.

type CIWorkflowConfig

type CIWorkflowConfig struct {
	Name                        string          `json:"name"`
	Description                 string          `json:"description,omitempty"`
	Disabled                    bool            `json:"disabled"`
	Locked                      bool            `json:"locked"`
	XcodeVersion                json.RawMessage `json:"xcode_version,omitempty"`
	MacOSVersion                json.RawMessage `json:"macos_version,omitempty"`
	StartConditions             json.RawMessage `json:"start_conditions,omitempty"`
	Actions                     json.RawMessage `json:"actions,omitempty"`
	PostActions                 json.RawMessage `json:"post_actions,omitempty"`
	Clean                       json.RawMessage `json:"clean,omitempty"`
	ContainerFilePath           string          `json:"container_file_path,omitempty"`
	Repo                        json.RawMessage `json:"repo,omitempty"`
	ProductEnvironmentVariables []string        `json:"product_environment_variables,omitempty"`
}

CIWorkflowConfig captures workflow fields surfaced by the web UI. Nested and evolving structures are kept as raw JSON for forward compatibility.

func ExtractWorkflowConfig

func ExtractWorkflowConfig(content json.RawMessage) (*CIWorkflowConfig, error)

ExtractWorkflowConfig extracts known workflow configuration fields from raw workflow content.

type CIWorkflowContent

type CIWorkflowContent struct {
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
}

CIWorkflowContent holds the workflow's configuration including its name.

type CIWorkflowFull

type CIWorkflowFull struct {
	ID      string          `json:"id"`
	Content json.RawMessage `json:"content"`
}

CIWorkflowFull is the full workflow body for GET/PUT round-trips. Uses json.RawMessage for Content to preserve unknown fields.

type CIWorkflowListResponse

type CIWorkflowListResponse struct {
	Items []CIWorkflow `json:"items"`
}

CIWorkflowListResponse is the response from the workflows endpoint.

type CIWorkflowUsage

type CIWorkflowUsage struct {
	WorkflowID             string       `json:"workflow_id"`
	WorkflowName           string       `json:"workflow_name,omitempty"`
	Usage                  []CIDayUsage `json:"usage,omitempty"`
	UsageInMinutes         int          `json:"usage_in_minutes,omitempty"`
	NumberOfBuilds         int          `json:"number_of_builds,omitempty"`
	PreviousUsageInMinutes int          `json:"previous_usage_in_minutes,omitempty"`
	PreviousNumberOfBuilds int          `json:"previous_number_of_builds,omitempty"`
}

CIWorkflowUsage describes per-workflow daily usage.

type Client

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

Client is an internal web API client using a web session cookie jar.

func NewCIClient

func NewCIClient(session *AuthSession) *Client

NewCIClient creates a CI API client reusing an authenticated web session. The CI API lives at /ci/api and uses the same session cookies as IRIS.

func NewClient

func NewClient(session *AuthSession) *Client

NewClient creates an internal web API client from an authenticated session.

func (*Client) CreateApp

func (c *Client) CreateApp(ctx context.Context, attrs AppCreateAttributes) (*AppResponse, error)

CreateApp creates an app with the internal web API.

func (*Client) CreateAppAvailability

func (c *Client) CreateAppAvailability(ctx context.Context, attrs AppAvailabilityCreateAttributes) (*AppAvailability, error)

CreateAppAvailability creates the initial app availability via the internal web API.

func (*Client) CreateAppDataUsage

func (c *Client) CreateAppDataUsage(ctx context.Context, appID string, tuple DataUsageTuple) (*AppDataUsage, error)

CreateAppDataUsage creates one data usage tuple for an app.

func (*Client) CreateSubscriptionSubmission

func (c *Client) CreateSubscriptionSubmission(ctx context.Context, subscriptionID string) (ReviewSubscriptionSubmission, error)

CreateSubscriptionSubmission attaches a subscription to the next app version review via the private web flow.

func (*Client) DeleteAppDataUsage

func (c *Client) DeleteAppDataUsage(ctx context.Context, appDataUsageID string) error

DeleteAppDataUsage deletes one appDataUsages resource.

func (*Client) DeleteCIProductEnvVar

func (c *Client) DeleteCIProductEnvVar(ctx context.Context, teamID, productID, varID string) error

DeleteCIProductEnvVar deletes a shared (product-level) environment variable. DELETE /teams/{teamID}/products/{productID}/product-environment-variables/{varID}

func (*Client) DeleteSubscriptionSubmission

func (c *Client) DeleteSubscriptionSubmission(ctx context.Context, subscriptionID string) error

DeleteSubscriptionSubmission detaches a subscription from the next app version review via the private web flow.

func (*Client) DownloadAttachment

func (c *Client) DownloadAttachment(ctx context.Context, signedURL string) ([]byte, int, error)

DownloadAttachment downloads binary attachment payload from a signed URL.

func (*Client) FindApp

func (c *Client) FindApp(ctx context.Context, bundleID string) (*AppResponse, error)

FindApp finds an existing app by bundle ID.

func (*Client) GetAppAvailability

func (c *Client) GetAppAvailability(ctx context.Context, appID string) (*AppAvailability, error)

GetAppAvailability retrieves the internal web app availability resource for an app.

func (*Client) GetAppDataUsagesPublishState

func (c *Client) GetAppDataUsagesPublishState(ctx context.Context, appID string) (*AppDataUsagesPublishState, error)

GetAppDataUsagesPublishState fetches publication state for app data usages.

func (*Client) GetCIBuildVersions

func (c *Client) GetCIBuildVersions(ctx context.Context, teamID string) (json.RawMessage, error)

GetCIBuildVersions retrieves build-version configuration options. GET /teams/{teamID}/configuration-options/build-versions

func (*Client) GetCIConfigurationOptions

func (c *Client) GetCIConfigurationOptions(ctx context.Context, teamID string) (json.RawMessage, error)

GetCIConfigurationOptions retrieves team-wide workflow editor options. GET /teams/{teamID}/configuration-options-v10

func (*Client) GetCIEncryptionKey

func (c *Client) GetCIEncryptionKey(ctx context.Context) (*CIEncryptionKeyResponse, error)

GetCIEncryptionKey fetches the P-256 public key for secret encryption. GET /auth/keys/client-encryption (relative to /ci/api base URL)

func (*Client) GetCIProductConfigurationOptions

func (c *Client) GetCIProductConfigurationOptions(ctx context.Context, teamID, productID string) (json.RawMessage, error)

GetCIProductConfigurationOptions retrieves product-scoped workflow editor options. GET /teams/{teamID}/products/{productID}/product-configuration-options-v4

func (*Client) GetCISchemes

func (c *Client) GetCISchemes(
	ctx context.Context,
	teamID, productID, containerFilePath string,
	limit int,
	continuationOffset string,
) (json.RawMessage, error)

GetCISchemes retrieves available schemes for a product. GET /teams/{teamID}/products/{productID}/schemes

func (*Client) GetCISlackChannels

func (c *Client) GetCISlackChannels(ctx context.Context, teamID string) (json.RawMessage, error)

GetCISlackChannels retrieves the team's Slack channel options for workflow notifications. GET /teams/{teamID}/integrations/slack/channels

func (*Client) GetCISlackProvider

func (c *Client) GetCISlackProvider(ctx context.Context, teamID string) (json.RawMessage, error)

GetCISlackProvider retrieves the team's Slack integration state for workflow notifications. GET /teams/{teamID}/integrations/slack

func (*Client) GetCITestDestinations

func (c *Client) GetCITestDestinations(ctx context.Context, teamID, xcodeVersion string) (json.RawMessage, error)

GetCITestDestinations retrieves workflow test destination options for an Xcode version. GET /teams/{teamID}/test-destinations-v3

func (*Client) GetCIUsageDays

func (c *Client) GetCIUsageDays(ctx context.Context, teamID, productID, start, end string) (*CIUsageDays, error)

GetCIUsageDays retrieves daily Xcode Cloud usage for a product in a date range.

func (*Client) GetCIUsageDaysOverall

func (c *Client) GetCIUsageDaysOverall(ctx context.Context, teamID, start, end string) (*CIUsageDays, error)

GetCIUsageDaysOverall retrieves daily Xcode Cloud usage overview for a team.

func (*Client) GetCIUsageMonths

func (c *Client) GetCIUsageMonths(ctx context.Context, teamID string, startMonth, startYear, endMonth, endYear int) (*CIUsageMonths, error)

GetCIUsageMonths retrieves monthly Xcode Cloud usage for a date range.

func (*Client) GetCIUsageSummary

func (c *Client) GetCIUsageSummary(ctx context.Context, teamID string) (*CIUsageSummary, error)

GetCIUsageSummary retrieves the Xcode Cloud plan usage summary.

func (*Client) GetCIWorkflow

func (c *Client) GetCIWorkflow(ctx context.Context, teamID, productID, workflowID string) (*CIWorkflowFull, error)

GetCIWorkflow gets a single workflow (full body including env vars). GET /teams/{teamID}/products/{productID}/workflows-v15/{workflowID}

func (*Client) ListAppDataUsageCategories

func (c *Client) ListAppDataUsageCategories(ctx context.Context) ([]AppDataUsageCategory, error)

ListAppDataUsageCategories lists available data usage category tokens.

func (*Client) ListAppDataUsageDataProtections

func (c *Client) ListAppDataUsageDataProtections(ctx context.Context) ([]AppDataUsageDataProtection, error)

ListAppDataUsageDataProtections lists available data usage data protection tokens.

func (*Client) ListAppDataUsagePurposes

func (c *Client) ListAppDataUsagePurposes(ctx context.Context) ([]AppDataUsagePurpose, error)

ListAppDataUsagePurposes lists available data usage purpose tokens.

func (*Client) ListAppDataUsages

func (c *Client) ListAppDataUsages(ctx context.Context, appID string) ([]AppDataUsage, error)

ListAppDataUsages lists data usage tuples for a specific app.

func (*Client) ListCIProductEnvVars

func (c *Client) ListCIProductEnvVars(ctx context.Context, teamID, productID string) ([]CIProductEnvironmentVariable, error)

ListCIProductEnvVars lists shared (product-level) environment variables. GET /teams/{teamID}/products/{productID}/product-environment-variables

func (*Client) ListCIProducts

func (c *Client) ListCIProducts(ctx context.Context, teamID string) (*CIProductListResponse, error)

ListCIProducts lists Xcode Cloud products for a team. The CI API does not expose pagination for this endpoint; limit=100 covers the vast majority of teams.

func (*Client) ListCIWorkflows

func (c *Client) ListCIWorkflows(ctx context.Context, teamID, productID string) (*CIWorkflowListResponse, error)

ListCIWorkflows lists Xcode Cloud workflows for a product.

func (*Client) ListResolutionCenterMessages

func (c *Client) ListResolutionCenterMessages(ctx context.Context, threadID string, plainText bool) ([]ResolutionCenterMessage, error)

ListResolutionCenterMessages lists thread messages and optional plain text body.

func (*Client) ListResolutionCenterThreadsBySubmission

func (c *Client) ListResolutionCenterThreadsBySubmission(ctx context.Context, reviewSubmissionID string) ([]ResolutionCenterThread, error)

ListResolutionCenterThreadsBySubmission lists threads for a review submission.

func (*Client) ListReviewAttachmentsBySubmission

func (c *Client) ListReviewAttachmentsBySubmission(ctx context.Context, reviewSubmissionID string, includeURL bool) ([]ReviewAttachment, error)

ListReviewAttachmentsBySubmission aggregates attachments across submission threads.

func (*Client) ListReviewAttachmentsByThread

func (c *Client) ListReviewAttachmentsByThread(ctx context.Context, threadID string, includeURL bool) ([]ReviewAttachment, error)

ListReviewAttachmentsByThread lists message and rejection attachments for a thread.

func (*Client) ListReviewRejections

func (c *Client) ListReviewRejections(ctx context.Context, threadID string) ([]ReviewRejection, error)

ListReviewRejections lists review rejections associated with a thread.

func (*Client) ListReviewSubmissionItems

func (c *Client) ListReviewSubmissionItems(ctx context.Context, reviewSubmissionID string) ([]ReviewSubmissionItem, error)

ListReviewSubmissionItems returns submission items for a review submission.

func (*Client) ListReviewSubmissions

func (c *Client) ListReviewSubmissions(ctx context.Context, appID string) ([]ReviewSubmission, error)

ListReviewSubmissions lists review submissions for a specific app ID.

func (*Client) ListReviewSubscriptions

func (c *Client) ListReviewSubscriptions(ctx context.Context, appID string) ([]ReviewSubscription, error)

ListReviewSubscriptions lists subscriptions and their next-version attach state for an app.

func (*Client) ListReviewThreadDetails

func (c *Client) ListReviewThreadDetails(ctx context.Context, threadID string, plainText bool, includeURL bool) (ReviewThreadDetails, error)

ListReviewThreadDetails fetches messages, rejections, and attachments for a thread in one pass.

func (*Client) LookupAPIKeyRoles

func (c *Client) LookupAPIKeyRoles(ctx context.Context, keyID string) (*APIKeyRoleLookup, error)

func (*Client) SetAppDataUsagesPublished

func (c *Client) SetAppDataUsagesPublished(ctx context.Context, publishStateID string, published bool) (*AppDataUsagesPublishState, error)

SetAppDataUsagesPublished updates publication state for app data usages.

func (*Client) SetCIProductEnvVar

func (c *Client) SetCIProductEnvVar(ctx context.Context, teamID, productID, varID string, req CIProductEnvVarRequest) (*CIProductEnvironmentVariable, error)

SetCIProductEnvVar creates or updates a shared (product-level) environment variable. PUT /teams/{teamID}/products/{productID}/product-environment-variables/{varID}

func (*Client) UpdateAppDataUsage

func (c *Client) UpdateAppDataUsage(ctx context.Context, appDataUsageID string, tuple DataUsageTuple) (*AppDataUsage, error)

UpdateAppDataUsage updates one appDataUsages resource to a target tuple.

func (*Client) UpdateCIWorkflow

func (c *Client) UpdateCIWorkflow(ctx context.Context, teamID, productID, workflowID string, content json.RawMessage) error

UpdateCIWorkflow updates a workflow (PUT full body). PUT /teams/{teamID}/products/{productID}/workflows-v15/{workflowID}

type DataUsageTuple

type DataUsageTuple struct {
	Category       string `json:"category,omitempty"`
	Purpose        string `json:"purpose,omitempty"`
	DataProtection string `json:"dataProtection"`
}

DataUsageTuple is the normalized tuple used to create/manage app data usages.

type KeyActor

type KeyActor struct {
	ID   string `json:"id"`
	Name string `json:"name,omitempty"`
}

type LoginCredentials

type LoginCredentials struct {
	Username string
	Password string
}

LoginCredentials holds Apple ID credentials.

type ResolutionCenterMessage

type ResolutionCenterMessage struct {
	ID               string       `json:"id"`
	CreatedDate      string       `json:"createdDate,omitempty"`
	MessageBody      string       `json:"messageBody,omitempty"`
	MessageBodyPlain string       `json:"messageBodyPlain,omitempty"`
	FromActor        *ReviewActor `json:"fromActor,omitempty"`
	RejectionIDs     []string     `json:"rejectionIds,omitempty"`
	AttachmentIDs    []string     `json:"attachmentIds,omitempty"`
}

ResolutionCenterMessage models a single message in a resolution center thread.

type ResolutionCenterThread

type ResolutionCenterThread struct {
	ID                      string   `json:"id"`
	ThreadType              string   `json:"threadType,omitempty"`
	State                   string   `json:"state,omitempty"`
	CreatedDate             string   `json:"createdDate,omitempty"`
	LastMessageResponseDate string   `json:"lastMessageResponseDate,omitempty"`
	CanDeveloperAddNote     bool     `json:"canDeveloperAddNote"`
	AppStoreVersionIDs      []string `json:"appStoreVersionIds,omitempty"`
	ReviewSubmissionID      string   `json:"reviewSubmissionId,omitempty"`
}

ResolutionCenterThread models thread metadata for app review issues.

type ReviewActor

type ReviewActor struct {
	ID        string `json:"id"`
	Type      string `json:"type,omitempty"`
	ActorType string `json:"actorType,omitempty"`
	Name      string `json:"name,omitempty"`
}

ReviewActor describes actor metadata from included relationships.

type ReviewAttachment

type ReviewAttachment struct {
	AttachmentID       string `json:"attachmentId"`
	SourceType         string `json:"sourceType"`
	FileName           string `json:"fileName,omitempty"`
	FileSize           int64  `json:"fileSize,omitempty"`
	AssetDeliveryState string `json:"assetDeliveryState,omitempty"`
	Downloadable       bool   `json:"downloadable"`
	DownloadURL        string `json:"downloadUrl,omitempty"`
	ThreadID           string `json:"threadId,omitempty"`
	MessageID          string `json:"messageId,omitempty"`
	ReviewRejectionID  string `json:"reviewRejectionId,omitempty"`
}

ReviewAttachment models message/rejection attachment metadata.

type ReviewRejection

type ReviewRejection struct {
	ID            string                  `json:"id"`
	Reasons       []ReviewRejectionReason `json:"reasons,omitempty"`
	AttachmentIDs []string                `json:"attachmentIds,omitempty"`
}

ReviewRejection models rejection records linked to resolution center.

type ReviewRejectionReason

type ReviewRejectionReason struct {
	ReasonSection     string `json:"reasonSection,omitempty"`
	ReasonDescription string `json:"reasonDescription,omitempty"`
	ReasonCode        string `json:"reasonCode,omitempty"`
}

ReviewRejectionReason captures normalized review rejection reason fields.

type ReviewSubmission

type ReviewSubmission struct {
	ID                       string                    `json:"id"`
	State                    string                    `json:"state,omitempty"`
	SubmittedDate            string                    `json:"submittedDate,omitempty"`
	Platform                 string                    `json:"platform,omitempty"`
	AppStoreVersionForReview *AppStoreVersionForReview `json:"appStoreVersionForReview,omitempty"`
	SubmittedByActor         *ReviewActor              `json:"submittedByActor,omitempty"`
	LastUpdatedByActor       *ReviewActor              `json:"lastUpdatedByActor,omitempty"`
	CreatedByActor           *ReviewActor              `json:"createdByActor,omitempty"`
}

ReviewSubmission captures high-level review submission metadata.

type ReviewSubmissionItem

type ReviewSubmissionItem struct {
	ID      string                         `json:"id"`
	Type    string                         `json:"type"`
	Related []ReviewSubmissionItemRelation `json:"related,omitempty"`
}

ReviewSubmissionItem models review submission item relationships.

type ReviewSubmissionItemRelation

type ReviewSubmissionItemRelation struct {
	Relationship string `json:"relationship"`
	Type         string `json:"type"`
	ID           string `json:"id"`
}

ReviewSubmissionItemRelation links a submission item to related resources.

type ReviewSubscription

type ReviewSubscription struct {
	ID                            string `json:"id"`
	GroupID                       string `json:"groupId,omitempty"`
	GroupReferenceName            string `json:"groupReferenceName,omitempty"`
	ProductID                     string `json:"productId,omitempty"`
	Name                          string `json:"name,omitempty"`
	State                         string `json:"state,omitempty"`
	IsAppStoreReviewInProgress    bool   `json:"isAppStoreReviewInProgress"`
	SubmitWithNextAppStoreVersion bool   `json:"submitWithNextAppStoreVersion"`
}

ReviewSubscription summarizes a subscription's attach state for the next app version review.

type ReviewSubscriptionSubmission

type ReviewSubscriptionSubmission struct {
	ID                            string `json:"id"`
	SubscriptionID                string `json:"subscriptionId,omitempty"`
	SubmitWithNextAppStoreVersion bool   `json:"submitWithNextAppStoreVersion"`
}

ReviewSubscriptionSubmission captures the hidden submission resource returned by the web attach flow.

type ReviewThreadDetails

type ReviewThreadDetails struct {
	Messages    []ResolutionCenterMessage `json:"messages,omitempty"`
	Rejections  []ReviewRejection         `json:"rejections,omitempty"`
	Attachments []ReviewAttachment        `json:"attachments,omitempty"`
}

ReviewThreadDetails bundles per-thread review records from shared API calls.

type TwoFactorRequiredError

type TwoFactorRequiredError struct {
	AppleIDSessionID string
	SCNT             string
}

TwoFactorRequiredError signals that the caller must submit a 2FA code.

func (*TwoFactorRequiredError) Error

func (e *TwoFactorRequiredError) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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