@iota-big3/sdk-gateway
Version:
Universal API Gateway with protocol translation, intelligent routing, rate limiting, health checking, and caching
45 lines • 1.64 kB
TypeScript
/**
* Validation utilities and type guards for gateway data
*/
import { DiscoveredService, GatewayRequest, GatewayResponse, HealthCheckResult, Protocol, RouteConfig, ServiceEndpoint } from '../types/gateway-types';
/**
* Type guard for GatewayRequest
*/
export declare function isGatewayRequest(value: unknown): value is GatewayRequest;
/**
* Type guard for Protocol
*/
export declare function isProtocol(value: unknown): value is Protocol;
/**
* Type guard for ServiceEndpoint
*/
export declare function isServiceEndpoint(value: unknown): value is ServiceEndpoint;
/**
* Type guard for RouteConfig
*/
export declare function isRouteConfig(value: unknown): value is RouteConfig;
/**
* Type guard for DiscoveredService
*/
export declare function isDiscoveredService(value: unknown): value is DiscoveredService;
/**
* Type guard for HealthCheckResult
*/
export declare function isHealthCheckResult(value: unknown): value is HealthCheckResult;
/**
* Validates and sanitizes external gateway request data
*/
export declare function validateGatewayRequest(data: unknown): GatewayRequest | null;
/**
* Validates service discovery data from external sources
*/
export declare function validateDiscoveredService(data: unknown): DiscoveredService | null;
/**
* Creates a type-safe API response
*/
export declare function createGatewayResponse<T = unknown>(data: T, status?: number, headers?: Record<string, string>): GatewayResponse;
/**
* Creates a type-safe error response
*/
export declare function createErrorResponse(message: string, status?: number, code?: string): GatewayResponse;
//# sourceMappingURL=validation.d.ts.map