Documentation
¶
Index ¶
- type DependencyGraph
- type DependencyNode
- type DirectDependency
- type PullResult
- type ReportFunc
- type ResolvedPackage
- type TpixSdk
- func (t *TpixSdk) BundlePackage(srcDir string, outputFile string, excludedFiles []string) (string, error)
- func (t *TpixSdk) CreateZoteroExport(name string, namespaceID string, libraryType string, libraryID int64, ...) (string, error)
- func (t *TpixSdk) DeleteZoteroExport(exportID string) error
- func (t *TpixSdk) DownloadPackage(pkgSpec string, noDeps bool) ([]ResolvedPackage, error)
- func (t *TpixSdk) DownloadProjectDependencies(projectDir string, dryRun bool) (*PullResult, error)
- func (t *TpixSdk) FetchZoteroExport(exportID string, writer io.Writer) error
- func (t *TpixSdk) GetNamespacePackages(namespace string) ([]api.PackageResponse, error)
- func (t *TpixSdk) GetPackageIndex() (string, error)
- func (t *TpixSdk) GetUserProfile() (*api.UserProfile, error)
- func (t *TpixSdk) ListZoteroLibraries() ([]api.ZoteroLibrary, error)
- func (t *TpixSdk) PushPackage(packagePath string, namespace string) (*api.UploadResponse, error)
- func (t *TpixSdk) QueryPackage(pkgSpec string) (*api.PackageResponse, error)
- func (t *TpixSdk) ResolveDependencies(pkgSpec string) (*DependencyGraph, error)
- func (t *TpixSdk) SearchPackages(namespace string, query string, kind string, category string, sort string, ...) (*api.SearchResponse, error)
- func (t *TpixSdk) WithReporter(reporter ReportFunc)
- type ZoteroLibrary
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DependencyGraph ¶ added in v0.15.0
type DependencyGraph struct {
Root *DependencyNode
// Packages is the flattened, de-duplicated set of all packages in the graph.
Packages []ResolvedPackage
}
DependencyGraph is the resolved dependency graph of a package.
type DependencyNode ¶ added in v0.15.0
type DependencyNode struct {
Package deps.Dependency
Cached bool
Children []*DependencyNode
}
DependencyNode is a package together with its resolved dependencies.
type DirectDependency ¶ added in v0.15.0
type DirectDependency struct {
Package deps.Dependency
Cached bool
}
DirectDependency is a direct import discovered while scanning a project.
type PullResult ¶ added in v0.15.0
type PullResult struct {
ProjectDir string
DryRun bool
Direct []DirectDependency
Packages []ResolvedPackage
}
PullResult is the outcome of DownloadProjectDependencies.
type ReportFunc ¶
type ReportFunc func(message string)
type ResolvedPackage ¶ added in v0.15.0
type ResolvedPackage struct {
Package deps.Dependency
Cached bool
}
ResolvedPackage is a package that was processed during a fetch operation, together with whether it was already present in the local cache.
type TpixSdk ¶ added in v0.10.0
type TpixSdk struct {
// contains filtered or unexported fields
}
func NewTpixSdk ¶ added in v0.10.0
func NewTpixSdk(httpClient *api.HttpClient, store storage.PackageStore) *TpixSdk
func (*TpixSdk) BundlePackage ¶ added in v0.10.0
func (*TpixSdk) CreateZoteroExport ¶ added in v0.10.0
func (t *TpixSdk) CreateZoteroExport(name string, namespaceID string, libraryType string, libraryID int64, collectionKey string, format string) (string, error)
CreateZoteroExport creates an export target on the TPIX server.
func (*TpixSdk) DeleteZoteroExport ¶ added in v0.10.0
DeleteZoteroExport deletes an existing Zotero export.
func (*TpixSdk) DownloadPackage ¶ added in v0.10.0
func (t *TpixSdk) DownloadPackage(pkgSpec string, noDeps bool) ([]ResolvedPackage, error)
DownloadPackage download Typst packages from TPIX server and returns the resolved package list, each tagged with whether it was already cached.
pkgSpec should follow the pattern: @namespace/name:version. Refer to deps.ParseDependency to know details. If noDeps is true, it will skip fetching transitive dependencies.
The first item of the returned slice will always be the pkgSpec.
func (*TpixSdk) DownloadProjectDependencies ¶ added in v0.10.0
func (t *TpixSdk) DownloadProjectDependencies(projectDir string, dryRun bool) (*PullResult, error)
func (*TpixSdk) FetchZoteroExport ¶ added in v0.10.0
FetchZoteroExport fetches the content of a Zotero export.
func (*TpixSdk) GetNamespacePackages ¶ added in v0.13.0
func (t *TpixSdk) GetNamespacePackages(namespace string) ([]api.PackageResponse, error)
GetNamespacePackages fetches all the packages in the specified namespace.
func (*TpixSdk) GetPackageIndex ¶ added in v0.10.0
GetPackageIndex retrieves a markdown file containing all user accessible package/template metadata. This API is dedicated for LLM use.
func (*TpixSdk) GetUserProfile ¶ added in v0.10.0
func (t *TpixSdk) GetUserProfile() (*api.UserProfile, error)
GetUserProfile queries the user profile from TPIX server.
func (*TpixSdk) ListZoteroLibraries ¶ added in v0.10.0
func (t *TpixSdk) ListZoteroLibraries() ([]api.ZoteroLibrary, error)
ListZoteroLibraries returns the list of Zotero libraries accessible to the user.
func (*TpixSdk) PushPackage ¶ added in v0.10.0
func (*TpixSdk) QueryPackage ¶ added in v0.10.0
func (t *TpixSdk) QueryPackage(pkgSpec string) (*api.PackageResponse, error)
func (*TpixSdk) ResolveDependencies ¶ added in v0.15.0
func (t *TpixSdk) ResolveDependencies(pkgSpec string) (*DependencyGraph, error)
ResolveDependencies resolves the full dependency graph of pkgSpec without downloading any package. Cache status is read from the local store.
func (*TpixSdk) SearchPackages ¶ added in v0.10.0
func (t *TpixSdk) SearchPackages(namespace string, query string, kind string, category string, sort string, limit int) (*api.SearchResponse, error)
SearchPackages searches Typst packages from TPIX server.
func (*TpixSdk) WithReporter ¶ added in v0.10.0
func (t *TpixSdk) WithReporter(reporter ReportFunc)
type ZoteroLibrary ¶
type ZoteroLibrary = api.ZoteroLibrary
ZoteroLibrary represents a Zotero library.
Directories
¶
| Path | Synopsis |
|---|---|
|
package storage defines interfaces for the storage of typst package cache, and retrieving of packages from the package cache.
|
package storage defines interfaces for the storage of typst package cache, and retrieving of packages from the package cache. |