import { AppNotFoundError } from "../common/errors" ; import Usecase from "../common/Usecase" ; import { IEntrypoint } from "../entities/Entrypoint" ; export default class GetEntrypointsByAppId extends Usecase { async exec ( appId ) { await this . authorizer . ensureCanGetEntrypoints ( ) ; const appExists = await this . storages . apps . oneExistsWithId ( appId ) ; if ( ! appExists ) { throw new AppNotFoundError ( appId , "id" ) ; } return this . storages . entrypoints . findManyByAppId ( appId ) ; } }