-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(module): implements plugin system for interceptor context parser
Oh where to begin? This rewrite allows for the OgmaModule to manage so much more than just HTTP, and in such a way that it's almost hard to describe. With the plugin system created, so long as a class extends the `AbstractInterceptorService` **and** the class does not have any extra injections needed, any class can be provided to the `interceptor` property of the `OgmaModuleOptions` to allow for interceptor request parsing. By default, the class that is provided is a `NoopInterceptorService` that really should only be there so an error gets thrown, but something had to be there for the Nest DI ssytem to not complain. Tests are still to come to help clean out dead code, but overall, the proof of concept is there and it works! re #7 #8 #9 #10 #11
- Loading branch information
Showing
42 changed files
with
199 additions
and
949 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './ogma-logger.decorator'; | ||
export * from './skip.decorator'; |
7 changes: 5 additions & 2 deletions
7
packages/nestjs-module/src/decorators/ogma-logger.decorator.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
import { Inject } from '@nestjs/common'; | ||
import { createProviderToken } from '../ogma.provider'; | ||
|
||
export const OgmaLogger = (topic: string | Function) => | ||
Inject(createProviderToken(typeof topic === 'function' ? topic.name : topic)); | ||
export function OgmaLogger(topic: string | Function) { | ||
return Inject( | ||
createProviderToken(typeof topic === 'function' ? topic.name : topic), | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
export * from './interceptor-error'; | ||
export * from './load-package'; | ||
export * from './optional-require'; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
export * from './decorators'; | ||
export * from './interceptor/ogma.interceptor'; | ||
export * from './interceptor/providers/abstract-interceptor.service'; | ||
export * from './interfaces/ogma-options.interface'; | ||
export * from './ogma.module'; | ||
export * from './ogma.service'; | ||
export * from './interfaces/ogma-options.interface'; | ||
export * from './interceptor/abstract-interceptor.service'; | ||
export { Type } from './interfaces/ogma-options.interface'; |
Empty file.
29 changes: 0 additions & 29 deletions
29
packages/nestjs-module/src/interceptor/gql-interceptor.service.ts
This file was deleted.
Oops, something went wrong.
110 changes: 0 additions & 110 deletions
110
packages/nestjs-module/src/interceptor/http-interceptor.service.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.