account_api

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GenerationThemes   = "themes"
	GenerationApps     = "apps"
	GenerationPlatform = "platform"
)
View Source
const ApiUrl = "https://api.haokeyingxiao.com"
View Source
const CacheFileName = "haoke-api-client-token.json"

Variables

This section is empty.

Functions

func InvalidateTokenCache

func InvalidateTokenCache() error

func SetUserAgent

func SetUserAgent(userAgent string)

Types

type AccountConfig

type AccountConfig interface {
	GetAccountEmail() string
	GetAccountPassword() string
}

type BinaryReviewResult

type BinaryReviewResult struct {
	BinaryId int `json:"binaryId"`
	Type     struct {
		Id          int    `json:"id"`
		Name        string `json:"name"`
		Description string `json:"description"`
	} `json:"type"`
	SubCheckResults []struct {
		SubCheck    string `json:"subCheck"`
		Status      string `json:"status"`
		Passed      bool   `json:"passed"`
		Message     string `json:"message"`
		HasWarnings bool   `json:"hasWarnings"`
	} `json:"subCheckResults"`
}

func (BinaryReviewResult) GetSummary

func (review BinaryReviewResult) GetSummary() string

func (BinaryReviewResult) HasPassed

func (review BinaryReviewResult) HasPassed() bool

func (BinaryReviewResult) HasWarnings

func (review BinaryReviewResult) HasWarnings() bool

func (BinaryReviewResult) IsPending

func (review BinaryReviewResult) IsPending() bool

type Client

type Client struct {
	Token token `json:"token"`
}

func NewApi

func NewApi(ctx context.Context, config AccountConfig) (*Client, error)

func (*Client) GetMyProfile

func (c *Client) GetMyProfile(ctx context.Context) (*MyProfile, error)

func (*Client) GetUserID

func (c *Client) GetUserID() string

func (*Client) NewAuthenticatedRequest

func (c *Client) NewAuthenticatedRequest(ctx context.Context, method, path string, body io.Reader) (*http.Request, error)

func (*Client) Producer

func (c *Client) Producer(ctx context.Context) (*ProducerEndpoint, error)

type CreateExtensionRequest

type CreateExtensionRequest struct {
	Name       string `json:"name,omitempty"`
	Generation struct {
		Name string `json:"name"`
	} `json:"generation"`
	ProducerID string `json:"producerId"`
}

type Extension

type Extension struct {
	Id             int    `json:"id"`
	ProducerId     string `json:"producerId"`
	Type           string `json:"type"`
	Name           string `json:"name"`
	StandardLocale Locale `json:"standardLocale"`
	Infos          []*struct {
		Id                 int          `json:"id"`
		Locale             Locale       `json:"locale"`
		Name               string       `json:"name"`
		Description        string       `json:"description"`
		InstallationManual string       `json:"installationManual"`
		ShortDescription   string       `json:"shortDescription"`
		Highlights         string       `json:"highlights"`
		Features           string       `json:"features"`
		Tags               []StoreTag   `json:"tags"`
		Videos             []StoreVideo `json:"videos"`
		Faqs               []StoreFaq   `json:"faqs"`
	} `json:"infos"`
	PriceModels                         *StorePrice       `json:"priceModels"`
	Variants                            []interface{}     `json:"variants"`
	Categories                          []StoreCategory   `json:"categories"`
	Category                            *StoreCategory    `json:"selectedFutureCategory"`
	Addons                              []interface{}     `json:"addons"`
	AutomaticBugfixVersionCompatibility bool              `json:"automaticBugfixVersionCompatibility"`
	ProductType                         *StoreProductType `json:"productType"`
	Status                              struct {
		Name string `json:"name"`
	} `json:"status"`
	IconURL                               string `json:"iconUrl"`
	IsCompatibleWithLatestShopwareVersion bool   `json:"isCompatibleWithLatestShopwareVersion"`
}

type ExtensionBinary

type ExtensionBinary struct {
	Id                         int                 `json:"id"`
	Name                       string              `json:"name"`
	Version                    string              `json:"version"`
	Status                     string              `json:"status"`
	CompatibleSoftwareVersions SoftwareVersionList `json:"compatibleSoftwareVersions"`
	CreationDate               string              `json:"creationDate"`
	LastChangeDate             string              `json:"lastChangeDate"`
}

type ExtensionCreate

type ExtensionCreate struct {
	SoftwareVersions []string                   `json:"softwareVersions"`
	Changelogs       []ExtensionUpdateChangelog `json:"changelogs"`
	Version          string                     `json:"version"`
}

type ExtensionGeneralInformation

type ExtensionGeneralInformation struct {
	Categories       []StoreCategory `json:"categories"`
	FutureCategories []StoreCategory `json:"futureCategories"`
	Addons           interface{}     `json:"addons"`
	Generations      []struct {
		Id          int    `json:"id"`
		Name        string `json:"name"`
		Description string `json:"description"`
	} `json:"generations"`
	ActivationStatus []struct {
		Id          int    `json:"id"`
		Name        string `json:"name"`
		Description string `json:"description"`
	} `json:"activationStatus"`
	ApprovalStatus []struct {
		Id          int    `json:"id"`
		Name        string `json:"name"`
		Description string `json:"description"`
	} `json:"approvalStatus"`
	LifecycleStatus []struct {
		Id          int    `json:"id"`
		Name        string `json:"name"`
		Description string `json:"description"`
	} `json:"lifecycleStatus"`
	BinaryStatus []struct {
		Id          int    `json:"id"`
		Name        string `json:"name"`
		Description string `json:"description"`
	} `json:"binaryStatus"`
	Locales  []Locale `json:"locales"`
	Licenses []struct {
		Id          int    `json:"id"`
		Name        string `json:"name"`
		Description string `json:"description"`
	} `json:"licenses"`
	PriceModels          []interface{}       `json:"priceModels"`
	SoftwareVersions     SoftwareVersionList `json:"softwareVersions"`
	DemoTypes            interface{}         `json:"demoTypes"`
	ProductTypes         []StoreProductType  `json:"productTypes"`
	ReleaseRequestStatus interface{}         `json:"releaseRequestStatus"`
}

type ExtensionImage

type ExtensionImage struct {
	Id         string `json:"id"`
	RemoteLink string `json:"remoteLink"`
	Details    []struct {
		Id        int    `json:"id"`
		Preview   bool   `json:"preview"`
		Activated bool   `json:"activated"`
		Caption   string `json:"caption"`
		Locale    Locale `json:"locale"`
	} `json:"details"`
	Priority int `json:"priority"`
}

type ExtensionUpdate

type ExtensionUpdate struct {
	Id                   int
	SoftwareVersions     []string                   `json:"softwareVersions"`
	IonCubeEncrypted     bool                       `json:"ionCubeEncrypted"`
	LicenseCheckRequired bool                       `json:"licenseCheckRequired"`
	Changelogs           []ExtensionUpdateChangelog `json:"changelogs"`
}

type ExtensionUpdateChangelog

type ExtensionUpdateChangelog struct {
	Locale string `json:"locale"`
	Text   string `json:"text"`
}

type ListExtensionCriteria

type ListExtensionCriteria struct {
	Limit         int    `schema:"limit,omitempty"`
	Offset        int    `schema:"offset,omitempty"`
	OrderBy       string `schema:"orderBy,omitempty"`
	OrderSequence string `schema:"orderSequence,omitempty"`
	Search        string `schema:"search,omitempty"`
}

type Locale

type Locale struct {
	Id   int    `json:"id"`
	Name string `json:"name"`
}

type LoginRequest

type LoginRequest struct {
	Email    string `json:"shopwareId"`
	Password string `json:"password"`
}

func (LoginRequest) GetAccountEmail

func (l LoginRequest) GetAccountEmail() string

func (LoginRequest) GetAccountPassword

func (l LoginRequest) GetAccountPassword() string

type MyProfile

type MyProfile struct {
	Id       string `json:"id"`
	Email    string `json:"email"`
	Banned   bool   `json:"banned"`
	Verified bool   `json:"verified"`
	Name     string `json:"name"`
}

type Producer

type Producer struct {
	Id      string `json:"id"`
	Prefix  string `json:"prefix"`
	Name    string `json:"name"`
	HaokeID string `json:"haokeId"`
}

type ProducerEndpoint

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

func (ProducerEndpoint) AddExtensionImage

func (e ProducerEndpoint) AddExtensionImage(ctx context.Context, extensionId int, file string) (*ExtensionImage, error)

func (ProducerEndpoint) CreateExtension

func (e ProducerEndpoint) CreateExtension(ctx context.Context, newExtension CreateExtensionRequest) (*Extension, error)

func (ProducerEndpoint) CreateExtensionBinary

func (e ProducerEndpoint) CreateExtensionBinary(ctx context.Context, extensionId int, create ExtensionCreate) (*ExtensionBinary, error)

func (ProducerEndpoint) DeleteExtension

func (e ProducerEndpoint) DeleteExtension(ctx context.Context, id string) error

func (ProducerEndpoint) DeleteExtensionImages

func (e ProducerEndpoint) DeleteExtensionImages(ctx context.Context, extensionId int, imageId string) error

func (ProducerEndpoint) Extensions

func (e ProducerEndpoint) Extensions(ctx context.Context, criteria *ListExtensionCriteria) ([]Extension, error)

func (ProducerEndpoint) GetBinaryReviewResults

func (e ProducerEndpoint) GetBinaryReviewResults(ctx context.Context, extensionId, binaryId int) ([]BinaryReviewResult, error)

func (ProducerEndpoint) GetExtensionBinaries

func (e ProducerEndpoint) GetExtensionBinaries(ctx context.Context, extensionId int) ([]*ExtensionBinary, error)

func (ProducerEndpoint) GetExtensionById

func (e ProducerEndpoint) GetExtensionById(ctx context.Context, id int) (*Extension, error)

func (ProducerEndpoint) GetExtensionByName

func (e ProducerEndpoint) GetExtensionByName(ctx context.Context, name string) (*Extension, error)

func (ProducerEndpoint) GetExtensionGeneralInfo

func (e ProducerEndpoint) GetExtensionGeneralInfo(ctx context.Context) (*ExtensionGeneralInformation, error)

func (ProducerEndpoint) GetExtensionImages

func (e ProducerEndpoint) GetExtensionImages(ctx context.Context, extensionId int) ([]*ExtensionImage, error)

func (ProducerEndpoint) GetId

func (e ProducerEndpoint) GetId() string

func (ProducerEndpoint) GetSoftwareVersions

func (e ProducerEndpoint) GetSoftwareVersions(ctx context.Context, generation string) (*SoftwareVersionList, error)

func (ProducerEndpoint) Profile

func (e ProducerEndpoint) Profile(ctx context.Context) (*Producer, error)

func (ProducerEndpoint) TriggerCodeReview

func (e ProducerEndpoint) TriggerCodeReview(ctx context.Context, extensionId int) error

func (ProducerEndpoint) UpdateExtension

func (e ProducerEndpoint) UpdateExtension(ctx context.Context, extension *Extension) error

func (ProducerEndpoint) UpdateExtensionBinaryFile

func (e ProducerEndpoint) UpdateExtensionBinaryFile(ctx context.Context, extensionId, binaryId int, zipPath string) error

func (ProducerEndpoint) UpdateExtensionBinaryInfo

func (e ProducerEndpoint) UpdateExtensionBinaryInfo(ctx context.Context, extensionId int, update ExtensionUpdate) error

func (ProducerEndpoint) UpdateExtensionIcon

func (e ProducerEndpoint) UpdateExtensionIcon(ctx context.Context, extensionId int, iconFile string) error

func (ProducerEndpoint) UpdateExtensionImage

func (e ProducerEndpoint) UpdateExtensionImage(ctx context.Context, extensionId int, image *ExtensionImage) error

type SoftwareVersion

type SoftwareVersion struct {
	Name       string `json:"version"`
	Selectable bool   `json:"selectable"`
}

type SoftwareVersionList

type SoftwareVersionList []SoftwareVersion

func (SoftwareVersionList) FilterOnVersion

func (list SoftwareVersionList) FilterOnVersion(constriant *version.Constraints) SoftwareVersionList

func (SoftwareVersionList) FilterOnVersionStringList

func (list SoftwareVersionList) FilterOnVersionStringList(constriant *version.Constraints) []string

type StoreCategory

type StoreCategory struct {
	Id          string      `json:"id"`
	Name        string      `json:"name"`
	Description string      `json:"description"`
	Parent      interface{} `json:"parent"`
	Position    int         `json:"position"`
	Public      bool        `json:"public"`
	Visible     bool        `json:"visible"`
	Suggested   bool        `json:"suggested"`
	Applicable  bool        `json:"applicable"`
	Details     interface{} `json:"details"`
	Active      bool        `json:"active"`
}

type StoreFaq

type StoreFaq struct {
	Question string `json:"question"`
	Answer   string `json:"answer"`
}

type StorePrice added in v1.0.0

type StorePrice struct {
	Type  string  `json:"type"`
	Money float32 `json:"money"`
}

type StoreProductType

type StoreProductType struct {
	Id          int    `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

type StoreTag

type StoreTag struct {
	Name string `json:"name"`
}

type StoreVideo

type StoreVideo struct {
	URL string `json:"url"`
}

Jump to

Keyboard shortcuts

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