Hi, we're seeing the same issue as reported here for the latest version of ABP (stable and preview versions) and Angular 18: https://abp.io/support/questions/7489/Proxy-generation-gives-Error-for-type-EntityAngular
Output on generating the proxy produces an invalid volo models.ts file:
export interface AggregateRoot<TKey> extends BasicAggregateRoot<TKey> {
extraProperties: Record<string, object>;
concurrencyStamp?: string;
}
export interface BasicAggregateRoot<TKey> extends Entity<TKey> {
}
export interface Entity {
}
Error message:
Error: src/app/proxy/volo/abp/domain/entities/models.ts:7:51 - error TS2315: Type 'Entity' is not generic.
7 export interface BasicAggregateRoot<TKey> extends Entity<TKey> {
~~~~~~~~~~~~
Command run to generate proxy:
abp generate-proxy -t ng -m core -u https://localhost:44311
Is there a suggested way to handle ActionResult custom endpoints e.g. suppose I have a custom controller with a custom endpoint:
namespace Core.Models.Transmittal
{
[RemoteService(Name = "Core")]
[Area("core")]
[ControllerName("Transmittal")]
[Route("api/core/transmittals")]
public class TransmittalController : TransmittalControllerBase, ITransmittalsAppService
{
[HttpGet]
[Route("my-custom-endpoint")]
public async Task<ActionResult<PagedResultDto<string>>> GetMyCustomEndpoint() { ... }
Upon running abp generate-proxy -t ng -m core -u https://localhost:44311
the output is a separate and invalid .ts file:
mvc\models.ts (note: this is invalid Typescript output; the below file does not compile)
export interface ActionResult {
}
export interface ActionResult<TValue> {
result: ActionResult;
value: TValue;
}
export interface IActionResult {
}
And in the generated proxy output transmittal.service.ts:
this.restService.request<any, ActionResult<PagedResultDto<string>>>({
method: 'GET',
url: '/api/core/transmittals/my-custom-endpoint',
params: { },
},
{ apiName: this.apiName,...config });
The endpoint only uses ActionResult to change the status response e.g. Ok() or NoContent() or some custom status code response but the actual output should just be the PagedResultDto<string>
Is there something I'm missing here? ActionResult<T> responses are a special exception so I'm not entirely sure why the mvc\models.ts output is showing the generated output of ActionResult<TValue> with a result self-referencing itself (this is invalid Typescript generation too so the output does not compile).