Skip to content

Commit e433e55

Browse files
committed
Enhance plugin list API with specs and operations details
- Updated build-master.yml to use .NET 10 and setup-dotnet v4. - Extended PluginsListResponse to include specifications and operations, including operation parameters. - Added new classes: PluginsListSpecification, PluginsListOperation, and PluginsListOperationParameter. - Improved API response to provide richer plugin metadata. #51
1 parent a032768 commit e433e55

3 files changed

Lines changed: 50 additions & 2 deletions

File tree

.github/workflows/build-master.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ jobs:
1414
uses: actions/checkout@v4
1515

1616
- name: Setup .NET Core
17-
uses: actions/setup-dotnet@v3.2.0
17+
uses: actions/setup-dotnet@v4
1818
with:
19-
dotnet-version: '9.0.x'
19+
dotnet-version: '10.0.x'
2020

2121
- name: Build
2222
run: dotnet build --configuration Release

src/FlowSynx.PluginRegistry.Application/Features/Plugins/Query/PluginsList/PluginsListHandler.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,27 @@ public async Task<PaginatedResult<PluginsListResponse>> Handle(PluginsListReques
4242
CategoryTitle = p.LatestVersion.PluginCategory.Title,
4343
LastUpdated = p.LastModifiedOn ?? p.CreatedOn,
4444
Tags = p.LatestVersion!.PluginVersionTags.Select(x => x.Tag!.Name),
45+
Specifications = p.LatestVersion!.Specifications.Select(x => new PluginsListSpecification
46+
{
47+
Name = x.Name,
48+
Description = x.Description,
49+
Type = x.Type,
50+
DefaultValue = x.DefaultValue,
51+
IsRequired = x.IsRequired
52+
}).ToList(),
53+
Operations = p.LatestVersion!.Operations.Select(x => new PluginsListOperation
54+
{
55+
Name = x.Name,
56+
Description = x.Description,
57+
Parameters = x.Parameters.Select(p => new PluginsListOperationParameter
58+
{
59+
Name = p.Name,
60+
Description = p.Description,
61+
Type = p.Type,
62+
DefaultValue = p.DefaultValue,
63+
IsRequired = p.IsRequired
64+
}).ToList()
65+
}).ToList(),
4566
TotalDownload = p.Versions.Sum(x=>x.Statistics.Count),
4667
IsTrusted = p.IsTrusted
4768
}).ToList();

src/FlowSynx.PluginRegistry.Application/Features/Plugins/Query/PluginsList/PluginsListResponse.cs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,34 @@ public class PluginsListResponse
88
public IEnumerable<string> Tags { get; set; } = new List<string>();
99
public IEnumerable<string> Owners { get; set; } = new List<string>();
1010
public string? CategoryTitle { get; set; }
11+
public List<PluginsListSpecification> Specifications { get; set; } = new List<PluginsListSpecification>();
12+
public List<PluginsListOperation> Operations { get; set; } = new List<PluginsListOperation>();
1113
public DateTime LastUpdated { get; set; }
1214
public int TotalDownload { get; set; } = 0;
1315
public bool IsTrusted { get; set; } = false;
16+
}
17+
18+
public class PluginsListOperation
19+
{
20+
public string Name { get; set; } = string.Empty;
21+
public string? Description { get; set; }
22+
public List<PluginsListOperationParameter> Parameters { get; set; } = new List<PluginsListOperationParameter>();
23+
}
24+
25+
public class PluginsListOperationParameter
26+
{
27+
public string Name { get; set; } = string.Empty;
28+
public string? Description { get; set; }
29+
public string? Type { get; set; }
30+
public string? DefaultValue { get; set; }
31+
public bool? IsRequired { get; set; } = false;
32+
}
33+
34+
public class PluginsListSpecification
35+
{
36+
public string Name { get; set; } = string.Empty;
37+
public string? Description { get; set; }
38+
public string? Type { get; set; }
39+
public string? DefaultValue { get; set; }
40+
public bool? IsRequired { get; set; } = false;
1441
}

0 commit comments

Comments
 (0)