storeassets

package
v1.261001.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Overview

Package storeassets shares the App Clip and preview folders used by metadata and migrate.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckExportTargets

func CheckExportTargets(root rootfs.Root, files []ExportFile, overwrite bool) error

CheckExportTargets validates every destination before an export writes files.

func ClosePreviews

func ClosePreviews(previews []PreviewLayout)

func Validate

func Validate(ctx context.Context, clip *AppClipLayout, previews []PreviewLayout) (cleanup func(), err error)

Validate snapshots each selected media file before inspecting it. Uploads use the snapshot, so a repository path swap after validation cannot change bytes.

func WriteExport

func WriteExport(ctx context.Context, root rootfs.Root, files []ExportFile, overwrite bool) ([]string, error)

WriteExport honors the same no-overwrite preflight for text and media.

Types

type AppClipLayout

type AppClipLayout struct {
	Action       string            `json:"action,omitempty"`
	Subtitles    map[string]string `json:"subtitles,omitempty"`
	HeaderImages map[string]string `json:"headerImages,omitempty"`
	// contains filtered or unexported fields
}

func ReadAppClip

func ReadAppClip(metadataDir string) (layout AppClipLayout, present bool, err error)

ReadAppClip reads only files below the selected metadata root. A canonical asset file expresses intent; empty folders left by exports do not.

func (*AppClipLayout) Close

func (clip *AppClipLayout) Close()

type ExportFile

type ExportFile struct {
	Path string
	Text *string
	URL  string
}

ExportFile is a file fetched from the selected version. URLs stay private to execution.

func ExportPlan

func ExportPlan(ctx context.Context, client *asc.Client, versionID, metadataPrefix string, clip, previews bool) ([]ExportFile, []string, error)

ExportPlan obtains all remote assets before touching the selected output root.

type ExportOptions

type ExportOptions struct {
	AppID, VersionID, MetadataPrefix string
	Clip, Previews, Overwrite        bool
}

ExportOptions binds cleanup to the exact selected target and layout.

type ImportPlan

type ImportPlan struct {
	Clip          *AppClipLayout
	Previews      []PreviewLayout
	Experience    asc.Resource[asc.AppClipDefaultExperienceAttributes]
	ClipID        string
	VersionID     string
	Localizations map[string]asc.Resource[asc.AppClipDefaultExperienceLocalizationAttributes]
	Headers       map[string]asc.Resource[asc.AppClipHeaderImageAttributes]
	// contains filtered or unexported fields
}

ImportPlan is a preflight snapshot. It selects only the requested version's experience and resolves missing-target ambiguity before any mutation.

func PrepareImport

func PrepareImport(ctx context.Context, client *asc.Client, appID, versionID string, clip *AppClipLayout, previews []PreviewLayout) (*ImportPlan, error)

func (*ImportPlan) Apply

func (p *ImportPlan) Apply(ctx context.Context, client *asc.Client, localeToID map[string]string) ([]asc.StoreAssetResult, error)

func (*ImportPlan) Changes

func (p *ImportPlan) Changes() []asc.StoreAssetChange

Changes describes the full target and content fingerprint used by metadata review/approval. No transfer is allowed to bypass these entries.

type ManagedExport

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

ManagedExport retains the inventory identity captured before any output writes.

func PrepareExport

func PrepareExport(root rootfs.Root, files []ExportFile, options ExportOptions) (*ManagedExport, error)

PrepareExport rejects malformed ownership and target conflicts before callers write ordinary metadata. Unselected scopes retain their existing ownership.

func (*ManagedExport) Write

func (p *ManagedExport) Write(ctx context.Context) ([]string, []string, error)

Write records pending bytes before publication. Cleanup happens only after every desired asset has been handled; failures preserve the recovery journal.

type PreviewLayout

type PreviewLayout struct {
	Locale      string `json:"locale"`
	DeviceType  string `json:"deviceType"`
	FileName    string `json:"fileName"`
	Path        string `json:"path"`
	PosterFrame string `json:"posterFrame,omitempty"`
	// contains filtered or unexported fields
}

func ReadPreviews

func ReadPreviews(base string) (previews []PreviewLayout, err error)

Jump to

Keyboard shortcuts

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