This commit enhances type safety and fixes type-related issues throughout the project including: - Updated type definitions in entities, repositories, and models - Improved type annotations in services and controllers - Fixed type issues in adapters and utilities - Enhanced test file type definitions - Added typings/index.d.ts for global type declarations 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude <noreply@anthropic.com>
27 lines
857 B
TypeScript
27 lines
857 B
TypeScript
import { Event, Inject } from '@eggjs/tegg';
|
|
import type { EggLogger } from 'egg';
|
|
import { PACKAGE_VERSION_ADDED } from './index.ts';
|
|
import { BUG_VERSIONS } from '../../common/constants.ts';
|
|
import type { BugVersionService } from '../service/BugVersionService.ts';
|
|
|
|
@Event(PACKAGE_VERSION_ADDED)
|
|
export class BugVersionFixHandler {
|
|
@Inject()
|
|
private readonly bugVersionService: BugVersionService;
|
|
|
|
@Inject()
|
|
private readonly logger: EggLogger;
|
|
|
|
async handle(fullname: string) {
|
|
if (fullname !== BUG_VERSIONS) return;
|
|
try {
|
|
const bugVersion = await this.bugVersionService.getBugVersion();
|
|
if (!bugVersion) return;
|
|
await this.bugVersionService.cleanBugVersionPackageCaches(bugVersion);
|
|
} catch (e) {
|
|
e.message = `[BugVersionFixHandler] clean cache failed: ${e.message}`;
|
|
this.logger.error(e);
|
|
}
|
|
}
|
|
}
|