diff --git a/.changeset/gentle-eels-shave.md b/.changeset/gentle-eels-shave.md new file mode 100644 index 000000000..4b7780a77 --- /dev/null +++ b/.changeset/gentle-eels-shave.md @@ -0,0 +1,5 @@ +--- +'@ogma/nestjs-module': patch +--- + +Update the service options provider to correctly pass on the options to the ogma creation process diff --git a/.changeset/loud-mice-shop.md b/.changeset/loud-mice-shop.md new file mode 100644 index 000000000..ed8692818 --- /dev/null +++ b/.changeset/loud-mice-shop.md @@ -0,0 +1,5 @@ +--- +'@ogma/logger': patch +--- + +Removed the index type from the ogma options to allow for better intellisense diff --git a/packages/logger/src/interfaces/ogma-options.ts b/packages/logger/src/interfaces/ogma-options.ts index 7cb4bf4ab..2b924d3d7 100644 --- a/packages/logger/src/interfaces/ogma-options.ts +++ b/packages/logger/src/interfaces/ogma-options.ts @@ -109,7 +109,6 @@ export interface OgmaOptions { * desired. */ each: boolean; - [index: string]: any; } const stream = process diff --git a/packages/nestjs-module/src/ogma.provider.ts b/packages/nestjs-module/src/ogma.provider.ts index fc6830c2b..413018d4d 100644 --- a/packages/nestjs-module/src/ogma.provider.ts +++ b/packages/nestjs-module/src/ogma.provider.ts @@ -23,7 +23,7 @@ export function createOgmaProvider(options?: Partial): Ogma { } export function createOgmaServiceOptions(options: OgmaModuleOptions): OgmaModuleOptions { - return options.service; + return options; } export function createOgmaTraceOptions(options: OgmaModuleOptions): Lowercase { diff --git a/packages/nestjs-module/test/ogma.provider.spec.ts b/packages/nestjs-module/test/ogma.provider.spec.ts index 851b72f4f..597998cfd 100644 --- a/packages/nestjs-module/test/ogma.provider.spec.ts +++ b/packages/nestjs-module/test/ogma.provider.spec.ts @@ -33,17 +33,14 @@ CreateOgmaInterceptorOptionsFactorySuite.run(); const CreateOgmaServiceOptionsSuite = suite('Create Ogma Service Options'); CreateOgmaServiceOptionsSuite('Should return the service options', () => { - is(createOgmaServiceOptions({ interceptor: {} }), undefined); + equal(createOgmaServiceOptions({}), {}); }); CreateOgmaServiceOptionsSuite('Should return actual options and not undefined', () => { equal( createOgmaServiceOptions({ - interceptor: {}, - service: { - json: false, - color: true, - application: 'something', - }, + json: false, + color: true, + application: 'something', }), { color: true,