ws-dottie
Version: 
Your friendly TypeScript companion for Washington State transportation APIs - WSDOT and WSF data with smart caching and React Query integration
34 lines • 1.38 kB
JavaScript
/**
 * fetch-dottie CLI
 *
 * Validated WSDOT/WSF API client with full Zod validation and data transformation.
 * This tool provides type-safe access to Washington State transportation APIs
 * with comprehensive error handling and data validation.
 *
 * Usage: fetch-dottie <function-name> [params] [--pretty=false]
 */
import { fetchZod } from "@/shared/fetching";
import { createSimpleCli } from "./cli-core";
import { generateDefaultExamples } from "./ui";
/**
 * Execute validated API call using Zod validation
 * @param endpoint - Endpoint definition with URL and input schema
 * @param params - Validated parameters to send with the request
 * @param _options - CLI options for request configuration
 * @returns Promise resolving to validated response data
 */
const executeDottie = async (endpoint, params, _options // Unused - validated fetching handles all transformations
) => {
    // Use the validated fetchZod function
    return await fetchZod({
        endpoint: endpoint.endpoint,
        inputSchema: endpoint.inputSchema,
        outputSchema: endpoint.outputSchema,
        params: params,
        logMode: "none",
    });
};
// Create and run CLI tool
createSimpleCli("fetch-dottie", "Validated WSDOT/WSF API client with Zod validation", "1.0.0", executeDottie, generateDefaultExamples("fetch-dottie"));
//# sourceMappingURL=fetch-dottie.js.map