mya-cli
Version:
MYA - AI-Powered Stock & Options Analysis CLI Tool
51 lines (50 loc) • 1.59 kB
TypeScript
/**
* MYA API Backend - HTTP Handler for Cloudflare Workers
*
* This module provides the main HTTP API handler for the MYA trading intelligence platform.
* It exposes REST endpoints for authentication, analysis requests, and system management.
*
* The server uses Hono framework for routing and middleware, providing:
* - Authentication and session management
* - Analysis request processing (options, volatility, earnings, etc.)
* - Health checks and service monitoring
* - CORS support for cross-origin requests
*
* All endpoints follow REST conventions and return JSON responses.
*
* @module worker
* @version 1.0.0
* @author MYA Team
*/
interface Env {
KV_NAMESPACE: KVNamespace;
API_URL?: string;
ENVIRONMENT?: string;
STYTCH_PROJECT_ID: string;
STYTCH_SECRET: string;
JWT_SECRET: string;
ALPHAVANTAGE_API_KEY: string;
POLYGON_API_KEY: string;
AI_GATEWAY_TOKEN: string;
AI_GATEWAY_ACCOUNT_ID: string;
GITHUB_TOKEN?: string;
AI: any;
VECTORIZE_INDEX: VectorizeIndex;
ETL_INGEST_KEY?: string;
ADMIN_CRON_KEY?: string;
}
interface ScheduledEvent {
cron: string;
scheduledTime: number;
}
declare global {
interface ExecutionContext {
waitUntil(promise: Promise<unknown>): void;
passThroughOnException(): void;
}
}
declare const _default: {
fetch: (request: Request, Env?: unknown, executionCtx?: import("hono").ExecutionContext) => Response | Promise<Response>;
scheduled: (event: ScheduledEvent, env: Env, _ctx: ExecutionContext) => Promise<void>;
};
export default _default;