first refactor
This commit is contained in:
parent
1f5dac28c7
commit
588f666943
84 changed files with 996 additions and 1062 deletions
|
|
@ -2,6 +2,7 @@ import { asClass, asFunction, createContainer, InjectionMode, type AwilixContain
|
|||
import type { BaseAppConfig as StockBotAppConfig, UnifiedAppConfig } from '@stock-bot/config';
|
||||
import { toUnifiedConfig } from '@stock-bot/config';
|
||||
import { HandlerRegistry } from '@stock-bot/handler-registry';
|
||||
import type { IServiceContainer } from '@stock-bot/services';
|
||||
import { appConfigSchema, type AppConfig } from '../config/schemas';
|
||||
import {
|
||||
registerApplicationServices,
|
||||
|
|
@ -163,7 +164,7 @@ export class ServiceContainerBuilder {
|
|||
|
||||
// Register service container aggregate
|
||||
container.register({
|
||||
serviceContainer: asFunction(
|
||||
serviceContainer: asFunction<IServiceContainer>(
|
||||
({
|
||||
config: _config,
|
||||
logger,
|
||||
|
|
@ -175,7 +176,7 @@ export class ServiceContainerBuilder {
|
|||
mongoClient,
|
||||
postgresClient,
|
||||
questdbClient,
|
||||
}) => ({
|
||||
}: ServiceDefinitions) => ({
|
||||
logger,
|
||||
cache,
|
||||
globalCache,
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import type { PostgreSQLClient } from '@stock-bot/postgres';
|
|||
import type { ProxyManager } from '@stock-bot/proxy';
|
||||
import type { QuestDBClient } from '@stock-bot/questdb';
|
||||
import type { QueueManager } from '@stock-bot/queue';
|
||||
import type { IServiceContainer } from '@stock-bot/types';
|
||||
import type { IServiceContainer } from '@stock-bot/services';
|
||||
import type { AppConfig } from '../config/schemas';
|
||||
import type { HandlerScanner } from '../scanner';
|
||||
|
||||
|
|
@ -24,7 +24,7 @@ export interface ServiceDefinitions {
|
|||
cache: CacheProvider | null;
|
||||
globalCache: CacheProvider | null;
|
||||
proxyManager: ProxyManager | null;
|
||||
browser: Browser;
|
||||
browser: Browser | null;
|
||||
queueManager: QueueManager | null;
|
||||
|
||||
// Database clients
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue