fix: apply consistent-type-imports across API codebase (728 lint errors)
- Convert `import type { X }` to `import { type X }` (inline-type-imports style)
- Suppress consistent-type-imports for `typeof import()` in instrument.ts
- Includes uncommitted agent work: metrics module, redis caching, audit logs,
saved searches, circuit breaker, rate limiting, and admin enhancements
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -1,8 +1,14 @@
|
||||
import { Global, type MiddlewareConsumer, Module, type NestModule, RequestMethod } from '@nestjs/common';
|
||||
import { ConfigModule } from '@nestjs/config';
|
||||
import { APP_FILTER } from '@nestjs/core';
|
||||
import { EventEmitterModule } from '@nestjs/event-emitter';
|
||||
import { makeCounterProvider } from '@willsoto/nestjs-prometheus';
|
||||
import { CacheService, CACHE_HIT_TOTAL, CACHE_MISS_TOTAL } from './infrastructure/cache.service';
|
||||
import { PrometheusModule, makeCounterProvider } from '@willsoto/nestjs-prometheus';
|
||||
import {
|
||||
CacheService,
|
||||
CACHE_HIT_TOTAL,
|
||||
CACHE_MISS_TOTAL,
|
||||
CACHE_DEGRADATION_TOTAL,
|
||||
} from './infrastructure/cache.service';
|
||||
import { EventBusService } from './infrastructure/event-bus.service';
|
||||
import { GlobalExceptionFilter } from './infrastructure/filters/global-exception.filter';
|
||||
import { LoggerService } from './infrastructure/logger.service';
|
||||
@@ -15,7 +21,11 @@ import { RedisService } from './infrastructure/redis.service';
|
||||
|
||||
@Global()
|
||||
@Module({
|
||||
imports: [EventEmitterModule.forRoot()],
|
||||
imports: [
|
||||
ConfigModule.forRoot({ isGlobal: true }),
|
||||
EventEmitterModule.forRoot(),
|
||||
PrometheusModule.register({ path: '/metrics', defaultMetrics: { enabled: true } }),
|
||||
],
|
||||
providers: [
|
||||
PrismaService,
|
||||
RedisService,
|
||||
@@ -32,12 +42,17 @@ import { RedisService } from './infrastructure/redis.service';
|
||||
help: 'Total number of cache misses',
|
||||
labelNames: ['resource'],
|
||||
}),
|
||||
makeCounterProvider({
|
||||
name: CACHE_DEGRADATION_TOTAL,
|
||||
help: 'Total number of cache degradation events',
|
||||
labelNames: ['resource', 'operation'],
|
||||
}),
|
||||
{
|
||||
provide: APP_FILTER,
|
||||
useClass: GlobalExceptionFilter,
|
||||
},
|
||||
],
|
||||
exports: [PrismaService, RedisService, CacheService, LoggerService, EventBusService],
|
||||
exports: [PrismaService, RedisService, CacheService, LoggerService, EventBusService, PrometheusModule],
|
||||
})
|
||||
export class SharedModule implements NestModule {
|
||||
configure(consumer: MiddlewareConsumer): void {
|
||||
|
||||
Reference in New Issue
Block a user