Documentation
¶
Index ¶
Constants ¶
View Source
const ( TpixServer = "https://tpix.typstify.com" TpixClientUserAgent = "tpix-client/v1.0.0" )
Variables ¶
This section is empty.
Functions ¶
func DownloadPackage ¶
DownloadPackage downloads a package, extracts it to the cache directory, and optionally saves the archive to output path.
Types ¶
type DeviceCodeResponse ¶
type ErrorResponse ¶
ErrorResponse represents a standard error response
type PackageResponse ¶
type PackageResponse struct {
ID string `json:"id"`
Name string `json:"name"`
Namespace string `json:"namespace"`
Description string `json:"description"`
HomepageURL string `json:"homepage_url"`
RepositoryURL string `json:"repository_url"`
License string `json:"license"`
CreatedAt *time.Time `json:"created_at"`
UpdatedAt *time.Time `json:"updated_at"`
LatestVersion PackageVersionInfo `json:"latest_version"`
Versions []PackageVersionInfo `json:"versions"`
}
PackageResponse represents a package details response
func FetchPackage ¶
func FetchPackage(namespace, name string) (*PackageResponse, error)
FetchPackage fetches package details from the TPIX server.
type PackageVersionInfo ¶
type PackageVersionInfo struct {
Version string `json:"version"`
TypstVersion string `json:"typst_version"`
SHA256 string `json:"sha256"`
PublishedAt *time.Time `json:"published_at"`
}
PackageVersionInfo represents package version information
type PackageVersionsResponse ¶
type PackageVersionsResponse struct {
Versions []PackageVersionInfo `json:"versions"`
}
PackageVersionsResponse represents the response from the versions endpoint
type SearchResponse ¶
type SearchResponse struct {
Query string `json:"query"`
Count int `json:"count"`
Results []SearchResult `json:"results"`
}
func SearchPackages ¶
func SearchPackages(query, namespace string, limit int) (*SearchResponse, error)
SearchPackages fetches packages matching a query from the TPIX server.
type SearchResult ¶
type TokenResponse ¶
type TokenResponse struct {
AccessToken string `json:"access_token"`
TokenType string `json:"token_type"`
ExpiresIn int `json:"expires_in"`
RefreshToken string `json:"refresh_token,omitempty"`
}
func DeviceLogin ¶
func DeviceLogin() (*TokenResponse, error)
type UploadResponse ¶
type UploadResponse struct {
SHA256 string `json:"sha256"`
Namespace string `json:"namespace"`
Package string `json:"package"`
Version string `json:"version"`
Size int64 `json:"size"`
ValidateReport []string `json:"report"`
}
UploadResponse represents an upload response. When the package validation does not pass, only ValidateReport is returned.
func UploadPackage ¶
func UploadPackage(packagePath, namespace string) (*UploadResponse, error)
UploadPackage uploads a package to the TPIX server.
Click to show internal directories.
Click to hide internal directories.