diff --git a/apps/stock/data-ingestion/package.json b/apps/stock/data-ingestion/package.json index f229156..3fd76d4 100644 --- a/apps/stock/data-ingestion/package.json +++ b/apps/stock/data-ingestion/package.json @@ -26,7 +26,8 @@ "@stock-bot/utils": "*", "@stock-bot/browser": "*", "@stock-bot/proxy": "*", - "hono": "^4.0.0" + "hono": "^4.0.0", + "pako": "^2.1.0" }, "devDependencies": { "typescript": "^5.0.0" diff --git a/apps/stock/data-ingestion/src/handlers/index.ts b/apps/stock/data-ingestion/src/handlers/index.ts index 4a4fda5..c1d4189 100644 --- a/apps/stock/data-ingestion/src/handlers/index.ts +++ b/apps/stock/data-ingestion/src/handlers/index.ts @@ -12,6 +12,7 @@ import { IbHandler } from './ib/ib.handler'; import { QMHandler } from './qm/qm.handler'; import { WebShareHandler } from './webshare/webshare.handler'; import { TradingViewHandler } from './tradingview/tradingview.handler'; +import { TeHandler } from './te/te.handler'; // Add more handler imports as needed @@ -27,7 +28,7 @@ export async function initializeAllHandlers(serviceContainer: IServiceContainer) // The HandlerScanner in the DI container will handle the actual registration // We just need to ensure handlers are imported so their decorators run - const handlers = [CeoHandler, IbHandler, QMHandler, WebShareHandler, TradingViewHandler]; + const handlers = [CeoHandler, IbHandler, QMHandler, WebShareHandler, TradingViewHandler, TeHandler]; logger.info('Handler imports loaded', { count: handlers.length, diff --git a/apps/stock/data-ingestion/src/handlers/te/actions/index.ts b/apps/stock/data-ingestion/src/handlers/te/actions/index.ts new file mode 100644 index 0000000..0acc02f --- /dev/null +++ b/apps/stock/data-ingestion/src/handlers/te/actions/index.ts @@ -0,0 +1,2 @@ +// Export all action functions here +// export * from './example.action'; \ No newline at end of file diff --git a/apps/stock/data-ingestion/src/handlers/te/shared/config.ts b/apps/stock/data-ingestion/src/handlers/te/shared/config.ts new file mode 100644 index 0000000..f49b9bb --- /dev/null +++ b/apps/stock/data-ingestion/src/handlers/te/shared/config.ts @@ -0,0 +1,6 @@ +export const TE_CONFIG = { + // Add configuration constants here + API_URL: 'https://api.example.com', + REQUEST_TIMEOUT: 30000, + KEY: 'tradingeconomics-charts-core-api-key', +}; \ No newline at end of file diff --git a/apps/stock/data-ingestion/src/handlers/te/shared/index.ts b/apps/stock/data-ingestion/src/handlers/te/shared/index.ts new file mode 100644 index 0000000..6f3dade --- /dev/null +++ b/apps/stock/data-ingestion/src/handlers/te/shared/index.ts @@ -0,0 +1,2 @@ +export * from './config'; +export * from './types'; \ No newline at end of file diff --git a/apps/stock/data-ingestion/src/handlers/te/shared/types.ts b/apps/stock/data-ingestion/src/handlers/te/shared/types.ts new file mode 100644 index 0000000..cee4327 --- /dev/null +++ b/apps/stock/data-ingestion/src/handlers/te/shared/types.ts @@ -0,0 +1,13 @@ +// Define types and interfaces for the TE handler here + +export interface TeData { + id: string; + name: string; + // Add more fields as needed +} + +export interface TeResponse { + data: TeData[]; + status: string; + timestamp: Date; +} \ No newline at end of file diff --git a/apps/stock/data-ingestion/src/handlers/te/te.handler.ts b/apps/stock/data-ingestion/src/handlers/te/te.handler.ts new file mode 100644 index 0000000..8043516 --- /dev/null +++ b/apps/stock/data-ingestion/src/handlers/te/te.handler.ts @@ -0,0 +1,29 @@ +import { + BaseHandler, + Handler, + Operation, + ScheduledOperation, +} from '@stock-bot/handlers'; + +@Handler('te') +export class TeHandler extends BaseHandler { + constructor(services: any) { + super(services); + } + + @Operation('example-operation') + async exampleOperation(): Promise { + this.logger.info('TE handler example operation executed'); + return { success: true }; + } + + @ScheduledOperation('te-scheduled-job', '0 0 * * *', { + priority: 5, + description: 'Daily TE handler scheduled job', + immediately: false, + }) + async scheduledJob(): Promise { + this.logger.info('TE handler scheduled job executed'); + return this.exampleOperation(); + } +} \ No newline at end of file diff --git a/apps/stock/tsconfig.json b/apps/stock/tsconfig.json index fcce235..d609f08 100644 --- a/apps/stock/tsconfig.json +++ b/apps/stock/tsconfig.json @@ -13,6 +13,8 @@ { "path": "./data-ingestion" }, { "path": "./data-pipeline" }, { "path": "./web-api" }, - { "path": "./web-app" } + { "path": "./web-app" }, + { "path": "./engine"}, + { "path": "./orchestrator"} ] } \ No newline at end of file diff --git a/bun.lock b/bun.lock index cd5f16c..213d4d8 100644 --- a/bun.lock +++ b/bun.lock @@ -78,6 +78,7 @@ "@stock-bot/stock-config": "*", "@stock-bot/utils": "*", "hono": "^4.0.0", + "pako": "^2.1.0", }, "devDependencies": { "typescript": "^5.0.0", @@ -1990,6 +1991,8 @@ "package-json-from-dist": ["package-json-from-dist@1.0.1", "", {}, "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw=="], + "pako": ["pako@2.1.0", "", {}, "sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug=="], + "parent-module": ["parent-module@1.0.1", "", { "dependencies": { "callsites": "^3.0.0" } }, "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g=="], "parseurl": ["parseurl@1.3.3", "", {}, "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ=="],