bundle_packager.go 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. package bundle_packager
  2. import (
  3. "github.com/langgenius/dify-plugin-daemon/internal/types/entities/bundle_entities"
  4. )
  5. type BundlePackager interface {
  6. // Export exports the bundle to a zip byte array
  7. Export() ([]byte, error)
  8. // Icon returns the icon of the bundle
  9. Icon() ([]byte, error)
  10. // Manifest returns the manifest of the bundle
  11. Manifest() (*bundle_entities.Bundle, error)
  12. // Remove removes a dependency from the bundle
  13. Remove(index int) error
  14. // Append Github Dependency appends a github dependency to the bundle
  15. AppendGithubDependency(repoPattern bundle_entities.GithubRepoPattern)
  16. // Append Marketplace Dependency appends a marketplace dependency to the bundle
  17. AppendMarketplaceDependency(marketplacePattern bundle_entities.MarketplacePattern)
  18. // Append Package Dependency appends a local package dependency to the bundle
  19. AppendPackageDependency(packagePath string)
  20. // ListDependencies lists all the dependencies of the bundle
  21. ListDependencies() ([]bundle_entities.Dependency, error)
  22. // Regenerate regenerates the bundle, replace the basic information of the bundle like name, labels, description, icon, etc.
  23. Regenerate(bundle bundle_entities.Bundle) error
  24. }