import { Prisma } from "@prisma/client" ; import { GrantIdentifier , OAuthScope , OAuthScopeRepository } from "@jmondi/oauth2-server" ; import { Client } from "../entities/client" ; import { Scope } from "../entities/scope" ; export class ScopeRepository implements OAuthScopeRepository { constructor ( private readonly repo ) { } async getAllByIdentifiers ( scopeNames ) { const scopes = await this . repo . findMany ( { where : { name : { in : scopeNames , } , } , } ) ; return scopes . map ( s => new Scope ( s ) ) ; } async finalize ( scopes , _identifier , _client , _user_id ? ) { return scopes ; } }