commit 2 refactor

This commit is contained in:
Boki 2026-10-20 14:35:45 -04:00
parent 588f666943
commit 32e43c9243
310 changed files with 33318 additions and 31189 deletions

View file

@ -3,16 +3,18 @@
* Pure types for handler metadata and registration
*/
import type { JobHandler, ScheduledJob } from '@stock-bot/types';
import type {
DecoratedHandlerClass,
HandlerRateLimitConfig,
JobHandler,
RateLimitWindow,
ScheduledJob,
} from '@stock-bot/types';
/**
* Rate limit configuration
*/
export interface RateLimitConfig {
points: number;
duration: number;
blockDuration?: number;
}
export type RateLimitConfig = HandlerRateLimitConfig & Partial<RateLimitWindow>;
/**
* Metadata for a single operation within a handler
@ -72,6 +74,6 @@ export interface RegistryStats {
*/
export interface HandlerDiscoveryResult {
handler: HandlerMetadata;
constructor: any;
constructor: DecoratedHandlerClass;
filePath?: string;
}

View file

@ -1,12 +1,7 @@
import { beforeEach, describe, expect, it, mock } from 'bun:test';
import type { JobHandler, ScheduledJob } from '@stock-bot/types';
import { HandlerRegistry } from '../src/registry';
import type {
HandlerConfiguration,
HandlerMetadata,
OperationMetadata,
ScheduleMetadata,
} from '../src/types';
import type { HandlerConfiguration, HandlerMetadata } from '../src/types';
describe('HandlerRegistry Edge Cases', () => {
let registry: HandlerRegistry;