jmcdo29/ogma

@ogma/nestjs-module v5

Closed this issue · 0 comments

A bit of a rewrite of the parsers and the delegator service itself. Now, instead of having a hard dependency on HttpInterceptorService,WsInterceptorService,GqlInterceptorService, and WsInterceptorService, the idea is to let each parser use @Parser('context-type') and inject the DiscoveryService, then onModuleInit resolve all the parsers and hold them in a local map of Record<string, AbstractInterceptorParser>. I'd like to stronger type that map, but it needs to stay at string so that context types other than just what Nest has already built can be used as well, like how necord has a context type of discord. Then, on request, something like const parser = this.parserMap[contextType]; parser.getSuccessContext(context) can be called. This should be more extensible for future parsers and additions to the framework