-
-
Notifications
You must be signed in to change notification settings - Fork 448
New API Function from PluginManifest and PluginManager #3419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
df84e02
e2d9148
b9c0eb7
55d1754
4744ff7
473b139
cbd8d22
171ebe9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
using System.Linq; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Flow.Launcher.Plugin; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Needed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Record class |
||
|
||
namespace Flow.Launcher.Core.ExternalPlugins | ||
{ | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -344,5 +344,62 @@ public interface IPublicAPI | |
/// Stop the loading bar in main window | ||
/// </summary> | ||
public void StopLoadingBar(); | ||
|
||
/// <summary> | ||
/// Update the plugin manifest | ||
/// </summary> | ||
/// <param name="usePrimaryUrlOnly"> | ||
/// FL has multiple urls to download the plugin manifest. Set this to true to only use the primary url. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Have we added support for multiple manifest urls or are they just mirrors? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
/// </param> | ||
/// <param name="token"></param> | ||
/// <returns>True if the manifest is updated successfully, false otherwise</returns> | ||
public Task<bool> UpdatePluginManifestAsync(bool usePrimaryUrlOnly = false, CancellationToken token = default); | ||
|
||
/// <summary> | ||
/// Get the plugin manifest | ||
/// </summary> | ||
/// <returns></returns> | ||
public IReadOnlyList<UserPlugin> GetPluginManifest(); | ||
|
||
/// <summary> | ||
/// Check if the plugin has been modified. | ||
/// If this plugin is updated, installed or uninstalled and users do not restart the app, | ||
/// it will be marked as modified | ||
/// </summary> | ||
/// <param name="id">Plugin id</param> | ||
/// <returns></returns> | ||
public bool PluginModified(string id); | ||
|
||
/// <summary> | ||
/// Update a plugin to new version, from a zip file. By default will remove the zip file if update is via url, | ||
/// unless it's a local path installation | ||
/// </summary> | ||
/// <param name="pluginMetadata">The metadata of the old plugin to update</param> | ||
/// <param name="plugin">The new plugin to update</param> | ||
/// <param name="zipFilePath"> | ||
/// Path to the zip file containing the plugin. It will be unzipped to the temporary directory, removed and installed. | ||
/// </param> | ||
/// <returns></returns> | ||
public Task UpdatePluginAsync(PluginMetadata pluginMetadata, UserPlugin plugin, string zipFilePath); | ||
|
||
/// <summary> | ||
/// Install a plugin. By default will remove the zip file if installation is from url, | ||
/// unless it's a local path installation | ||
/// </summary> | ||
/// <param name="plugin">The plugin to install</param> | ||
/// <param name="zipFilePath"> | ||
/// Path to the zip file containing the plugin. It will be unzipped to the temporary directory, removed and installed. | ||
/// </param> | ||
public void InstallPlugin(UserPlugin plugin, string zipFilePath); | ||
|
||
/// <summary> | ||
/// Uninstall a plugin | ||
/// </summary> | ||
/// <param name="pluginMetadata">The metadata of the plugin to uninstall</param> | ||
/// <param name="removePluginSettings"> | ||
/// Plugin has their own settings. If this is set to true, the plugin settings will be removed. | ||
/// </param> | ||
/// <returns></returns> | ||
public Task UninstallPluginAsync(PluginMetadata pluginMetadata, bool removePluginSettings = false); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
using System; | ||
|
||
namespace Flow.Launcher.Plugin | ||
{ | ||
/// <summary> | ||
/// User Plugin Model for Flow Launcher | ||
/// </summary> | ||
public record UserPlugin | ||
{ | ||
/// <summary> | ||
/// Unique identifier of the plugin | ||
/// </summary> | ||
public string ID { get; set; } | ||
|
||
/// <summary> | ||
/// Name of the plugin | ||
/// </summary> | ||
public string Name { get; set; } | ||
|
||
/// <summary> | ||
/// Description of the plugin | ||
/// </summary> | ||
public string Description { get; set; } | ||
|
||
/// <summary> | ||
/// Author of the plugin | ||
/// </summary> | ||
public string Author { get; set; } | ||
|
||
/// <summary> | ||
/// Version of the plugin | ||
/// </summary> | ||
public string Version { get; set; } | ||
|
||
/// <summary> | ||
/// Allow language of the plugin <see cref="AllowedLanguage"/> | ||
/// </summary> | ||
public string Language { get; set; } | ||
|
||
/// <summary> | ||
/// Website of the plugin | ||
/// </summary> | ||
public string Website { get; set; } | ||
|
||
/// <summary> | ||
/// URL to download the plugin | ||
/// </summary> | ||
public string UrlDownload { get; set; } | ||
|
||
/// <summary> | ||
/// URL to the source code of the plugin | ||
/// </summary> | ||
public string UrlSourceCode { get; set; } | ||
|
||
/// <summary> | ||
/// Local path where the plugin is installed | ||
/// </summary> | ||
public string LocalInstallPath { get; set; } | ||
|
||
/// <summary> | ||
/// Icon path of the plugin | ||
/// </summary> | ||
public string IcoPath { get; set; } | ||
|
||
/// <summary> | ||
/// The date when the plugin was last updated | ||
/// </summary> | ||
public DateTime? LatestReleaseDate { get; set; } | ||
|
||
/// <summary> | ||
/// The date when the plugin was added to the local system | ||
/// </summary> | ||
public DateTime? DateAdded { get; set; } | ||
|
||
/// <summary> | ||
/// Indicates whether the plugin is installed from a local path | ||
/// </summary> | ||
public bool IsFromLocalInstallPath => !string.IsNullOrEmpty(LocalInstallPath); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,8 +18,6 @@ | |
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\Flow.Launcher.Infrastructure\Flow.Launcher.Infrastructure.csproj" /> | ||
<ProjectReference Include="..\..\Flow.Launcher.Core\Flow.Launcher.Core.csproj" /> | ||
<ProjectReference Include="..\..\Flow.Launcher.Plugin\Flow.Launcher.Plugin.csproj" /> | ||
</ItemGroup> | ||
|
||
|
@@ -37,4 +35,8 @@ | |
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="SharpZipLib" Version="1.4.2" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this is used right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Previous version also refers to this package as transitive package from |
||
</ItemGroup> | ||
</Project> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Record class
UserPlugin
is moved toFlow.Launcher.Plugin
, so we need to use this namespace here