UNPKG

apx-toolkit

Version:

Automatically discover APIs and generate complete integration packages: code in 12 languages, TypeScript types, test suites, SDK packages, API documentation, mock servers, performance reports, and contract tests. Saves 2-4 weeks of work in seconds.

61 lines 2.44 kB
/** * Core Runner - Decoupled execution logic for APX * This module contains the core APX functionality without Apify Actor dependencies * Can be used by CLI, test scripts, or other integrations * * Key Decoupling Features: * - Accepts native TypeScript objects (ActorInput) instead of reading from Apify KeyValueStore * - Uses Crawlee's local storage (works without Apify platform) * - Returns structured results instead of pushing to global Dataset * - Fully executable outside Apify environment */ import type { ActorInput } from './types.js'; import { ProgressTracker } from './utils/progress-tracker.js'; export interface APXResult { summary: { apisDiscovered: number; requestsProcessed: number; itemsExtracted: number; discoveryDuration: number; totalDuration: number; }; artifacts: { codeSnippets: Record<string, any[]>; typescriptTypes: string; testSuites: any[]; sdkPackages: any[]; documentation: any[]; examples: any[]; }; data: any[]; statistics: any; } /** * Core APX execution function * Runs the complete APX workflow without Apify Actor dependencies * * Decoupling Strategy: * 1. Input: Accepts native TypeScript object (ActorInput) instead of reading from Apify KeyValueStore * 2. Crawlee Setup: Uses Crawlee's local storage automatically (works without Apify platform) * - RequestQueue, Dataset, and other storage clients work locally via file system * - No special configuration needed - Crawlee detects environment automatically * 3. Output: Collects generated data into structured object (APXResult) for return * - Data is collected from Dataset after processing * - All artifacts are structured and returned to caller * * This allows APX to run in multiple environments: * - Apify Actor (via main.ts) * - CLI tool (via cli.ts) * - Test scripts (via test-main.ts) * - Any Node.js environment * * @param input - Configuration input (native TypeScript object) * @param options - Optional execution options (progress callbacks, error handlers) * @returns Structured result with all generated artifacts and data */ export declare function runAPXCore(input: ActorInput, options?: { onProgress?: (message: string) => void; onError?: (error: Error) => void; progressTracker?: ProgressTracker; }): Promise<APXResult>; //# sourceMappingURL=core-runner.d.ts.map