fix issues
This commit is contained in:
@@ -76,6 +76,7 @@ export class DemoLoginUseCase implements UseCase<DemoLoginInput, void, DemoLogin
|
||||
const passwordHashModule = await import('@core/identity/domain/value-objects/PasswordHash');
|
||||
const passwordHash = passwordHashModule.PasswordHash.fromHash(hashedPassword);
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const userProps: any = {
|
||||
id: userId,
|
||||
displayName: config.name,
|
||||
|
||||
@@ -6,9 +6,6 @@ import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
|
||||
import { writeFileSync } from 'fs';
|
||||
import { join } from 'path';
|
||||
import { AppModule } from './app.module';
|
||||
import { AuthenticationGuard } from './domain/auth/AuthenticationGuard';
|
||||
import { AuthorizationGuard } from './domain/auth/AuthorizationGuard';
|
||||
import { FeatureAvailabilityGuard } from './domain/policy/FeatureAvailabilityGuard';
|
||||
import { getGenerateOpenapi } from './env';
|
||||
|
||||
async function bootstrap() {
|
||||
@@ -65,9 +62,8 @@ async function bootstrap() {
|
||||
.addTag('analytics', 'Analytics and reporting endpoints')
|
||||
.build();
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const document = SwaggerModule.createDocument(app as any, config);
|
||||
SwaggerModule.setup('api/docs', app as any, document);
|
||||
const document = SwaggerModule.createDocument(app, config);
|
||||
SwaggerModule.setup('api/docs', app, document);
|
||||
|
||||
// OpenAPI export
|
||||
if (generateOpenapi) {
|
||||
@@ -83,8 +79,8 @@ async function bootstrap() {
|
||||
await app.listen(3000);
|
||||
console.log('✅ API Server started successfully on port 3000');
|
||||
console.log('📚 Swagger docs: http://localhost:3000/api/docs');
|
||||
} catch (error: any) {
|
||||
console.error('❌ Failed to start API server:', error.message);
|
||||
} catch (error: unknown) {
|
||||
console.error('❌ Failed to start API server:', error instanceof Error ? error.message : 'Unknown error');
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
@@ -95,8 +91,8 @@ process.on('uncaughtException', (error) => {
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
process.on('unhandledRejection', (reason: any) => {
|
||||
console.error('🚨 Unhandled Rejection:', reason?.message || reason);
|
||||
process.on('unhandledRejection', (reason: unknown) => {
|
||||
console.error('🚨 Unhandled Rejection:', reason instanceof Error ? reason.message : reason);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
|
||||
24
apps/api/src/shared/logging/InitializationLogger.ts
Normal file
24
apps/api/src/shared/logging/InitializationLogger.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
export class InitializationLogger {
|
||||
private static instance: InitializationLogger;
|
||||
|
||||
private constructor() {}
|
||||
|
||||
static getInstance(): InitializationLogger {
|
||||
if (!InitializationLogger.instance) {
|
||||
InitializationLogger.instance = new InitializationLogger();
|
||||
}
|
||||
return InitializationLogger.instance;
|
||||
}
|
||||
|
||||
log(message: string): void {
|
||||
console.log(`[Initialization] ${message}`);
|
||||
}
|
||||
|
||||
error(message: string): void {
|
||||
console.error(`[Initialization] ${message}`);
|
||||
}
|
||||
|
||||
warn(message: string): void {
|
||||
console.warn(`[Initialization] ${message}`);
|
||||
}
|
||||
}
|
||||
7
apps/api/src/shared/logging/LoggedProvider.ts
Normal file
7
apps/api/src/shared/logging/LoggedProvider.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { Provider } from '@nestjs/common';
|
||||
import { InitializationLogger } from './InitializationLogger';
|
||||
|
||||
export function createLoggedProviders(providers: Provider[], logger: InitializationLogger): Provider[] {
|
||||
logger.log(`Creating ${providers.length} providers`);
|
||||
return providers;
|
||||
}
|
||||
Reference in New Issue
Block a user