| 1 | using AgentForge.Abstractions; |
| 2 | using AgentForge.Contracts; |
| 3 | |
| 4 | namespace AgentForge.Plugin.Org.Web.Components; |
| 5 | |
| 6 | internal static class ForgeOrgCatalogRepoMapping |
| 7 | { |
| 8 | internal static IReadOnlyList<ForgeOrgCatalogRepoItem> ToItems(IReadOnlyList<RepoResponse> repos) => |
| 9 | repos.Select(repo => new ForgeOrgCatalogRepoItem( |
| 10 | repo.Name, |
| 11 | repo.Visibility, |
| 12 | repo.DriveMode, |
| 13 | ForgeRepoNames.ToUrlPath(repo.Name), |
| 14 | repo.Org, |
| 15 | repo.Group, |
| 16 | repo.CreatedAt)).ToList(); |
| 17 | |
| 18 | internal static IReadOnlyList<RepoResponse> ToResponses(IReadOnlyList<ForgeOrgCatalogRepoItem> repos) => |
| 19 | repos.Select(repo => new RepoResponse( |
| 20 | Id: repo.Name, |
| 21 | Name: repo.Name, |
| 22 | Description: "", |
| 23 | DriveMode: repo.DriveMode, |
| 24 | CloneUrl: "", |
| 25 | CreatedAt: repo.CreatedAt ?? DateTimeOffset.MinValue, |
| 26 | Group: repo.Group, |
| 27 | Org: repo.Org, |
| 28 | Visibility: repo.Visibility)).ToList(); |
| 29 | } |
| 30 | |
View only · write via MCP/CIDE