refactor(api): rm unused API props

This commit is contained in:
Collin Barrett 2025-06-28 12:18:47 -05:00 committed by Collin Barrett
parent d4281563a7
commit a374c67b4c
10 changed files with 10 additions and 44 deletions

View file

@ -15,10 +15,7 @@ public async Task<List<Response>> ExecuteAsync(CancellationToken ct)
.Select(l => new Response(
l.Id,
l.Iso6391,
l.Name,
l.FilterListLanguages
.OrderBy(fl => fl.FilterListId)
.Select(fl => fl.FilterListId)
l.Name
))
.TagWith(nameof(GetLanguages))
.ToListAsync(ct);
@ -28,6 +25,5 @@ public async Task<List<Response>> ExecuteAsync(CancellationToken ct)
/// <param name="Id" example="37">The identifier.</param>
/// <param name="Iso6391" example="en">The unique ISO 639-1 code.</param>
/// <param name="Name" example="English">The unique ISO name.</param>
/// <param name="FilterListIds" example="[ 114, 141 ]">The identifiers of the FilterLists targeted by this Language.</param>
public sealed record Response(short Id, string Iso6391, string Name, IEnumerable<int> FilterListIds);
public sealed record Response(short Id, string Iso6391, string Name);
}

View file

@ -18,10 +18,7 @@ public async Task<List<Response>> ExecuteAsync(CancellationToken ct)
l.Url,
l.PermitsModification,
l.PermitsDistribution,
l.PermitsCommercialUse,
l.FilterLists
.OrderBy(f => f.Id)
.Select(f => f.Id)
l.PermitsCommercialUse
))
.TagWith(nameof(GetLicenses))
.ToListAsync(ct);
@ -34,13 +31,11 @@ public async Task<List<Response>> ExecuteAsync(CancellationToken ct)
/// <param name="PermitsModification" example="false">If the License permits modification.</param>
/// <param name="PermitsDistribution" example="false">If the License permits distribution.</param>
/// <param name="PermitsCommercialUse" example="false">If the License permits commercial use.</param>
/// <param name="FilterListIds" example="[ 6, 31 ]">The identifiers of the FilterLists released under this License.</param>
public sealed record Response(
int Id,
string Name,
Uri? Url,
bool PermitsModification,
bool PermitsDistribution,
bool PermitsCommercialUse,
IEnumerable<int> FilterListIds);
bool PermitsCommercialUse);
}

View file

@ -17,10 +17,7 @@ public async Task<List<Response>> ExecuteAsync(CancellationToken ct)
m.Name,
m.Url,
m.EmailAddress,
m.TwitterHandle,
m.FilterListMaintainers
.OrderBy(fm => fm.FilterListId)
.Select(fm => fm.FilterListId)
m.TwitterHandle
))
.TagWith(nameof(GetMaintainers))
.ToListAsync(ct);
@ -32,12 +29,10 @@ public async Task<List<Response>> ExecuteAsync(CancellationToken ct)
/// <param name="Url" example="https://easylist.to/">The URL of the home page.</param>
/// <param name="EmailAddress" example="null">The email address.</param>
/// <param name="TwitterHandle" example="null">The Twitter handle.</param>
/// <param name="FilterListIds" example="[ 11, 13, 301 ]">The identifiers of the FilterLists maintained by this Maintainer.</param>
public sealed record Response(
int Id,
string Name,
Uri? Url,
string? EmailAddress,
string? TwitterHandle,
IEnumerable<int> FilterListIds);
string? TwitterHandle);
}

View file

@ -17,13 +17,7 @@ public async Task<List<Response>> ExecuteAsync(CancellationToken ct)
s.Id,
s.Name,
s.Description,
s.Url,
s.FilterListSyntaxes
.OrderBy(fs => fs.FilterListId)
.Select(fs => fs.FilterListId),
s.SoftwareSyntaxes
.OrderBy(ss => ss.SoftwareId)
.Select(ss => ss.SoftwareId)
s.Url
))
.TagWith(nameof(GetSyntaxes))
.ToListAsync(ct);
@ -34,13 +28,9 @@ public async Task<List<Response>> ExecuteAsync(CancellationToken ct)
/// <param name="Name" example="Adblock Plus">The unique name.</param>
/// <param name="Description" example="null">The description.</param>
/// <param name="Url" example="https://adblockplus.org/filters">The URL of the home page.</param>
/// <param name="FilterListIds" example="[ 2, 6, 11 ]">The identifiers of the FilterLists implementing this Syntax.</param>
/// <param name="SoftwareIds" example="[ 1, 2, 3 ]">The identifiers of the Software that supports this Syntax.</param>
public sealed record Response(
short Id,
string Name,
string? Description,
Uri? Url,
IEnumerable<int> FilterListIds,
IEnumerable<short> SoftwareIds);
Uri? Url);
}

View file

@ -16,10 +16,7 @@ public async Task<List<Response>> ExecuteAsync(CancellationToken ct)
(
t.Id,
t.Name,
t.Description,
t.FilterListTags
.OrderBy(flt => flt.FilterListId)
.Select(flt => flt.FilterListId)
t.Description
))
.TagWith(nameof(GetTags))
.ToListAsync(ct);
@ -29,6 +26,5 @@ public async Task<List<Response>> ExecuteAsync(CancellationToken ct)
/// <param name="Id" example="2">The identifier.</param>
/// <param name="Name" example="ads">The unique name.</param>
/// <param name="Description" example="Blocks advertisements">The description.</param>
/// <param name="FilterListIds" example="[ 1, 3, 6 ]">The identifiers of the FilterLists to which this Tag is applied.</param>
public sealed record Response(int Id, string Name, string? Description, IEnumerable<int> FilterListIds);
public sealed record Response(int Id, string Name, string? Description);
}

View file

@ -2,5 +2,4 @@ export interface Language {
id: number;
iso6391: string;
name: string;
filterListIds: number[];
}

View file

@ -5,5 +5,4 @@ export interface License {
permitsModification: boolean;
permitsDistribution: boolean;
permitsCommercialUse: boolean;
filterListIds: number[];
}

View file

@ -4,5 +4,4 @@ export interface Maintainer {
url?: string;
emailAddress?: string;
twitterHandle?: string;
filterListIds: number[];
}

View file

@ -3,6 +3,4 @@ export interface Syntax {
name: string;
description?: string;
url?: string;
filterListIds: number[];
softwareIds: number[];
}

View file

@ -2,5 +2,4 @@ export interface Tag {
id: number;
name: string;
description?: string;
filterListIds: number[];
}