@ronnakamoto/inp-middleware
Version:
INP Protocol middleware for Express.js and Next.js applications - API-driven implementation with automatic metrics integration
46 lines • 1.58 kB
TypeScript
/**
* INP API Client
*
* HTTP client for communicating with the INP platform APIs.
* This client handles all interactions with the INP platform
* without any direct function calls or imports from the platform.
*/
import { INPClientConfig, INPDiscoveryRequest, INPPaymentValidationRequest, INPServiceInvocationRequest, INPDiscoveryResult, INPPaymentValidationResult, INPServiceInvocationResult, INPLogger } from '../types';
export declare class INPClient {
private config;
private logger;
constructor(config?: Partial<INPClientConfig>, logger?: INPLogger);
/**
* Fetch INP discovery endpoint for a project
*/
getDiscoveryEndpoint(request: INPDiscoveryRequest): Promise<INPDiscoveryResult>;
/**
* Validate payment through the INP platform
*/
validatePayment(request: INPPaymentValidationRequest): Promise<INPPaymentValidationResult>;
/**
* Invoke a service through the INP platform
*/
invokeService(request: INPServiceInvocationRequest): Promise<INPServiceInvocationResult>;
/**
* Check if a project has payment-enabled endpoints
*/
checkProjectPaymentStatus(projectId: string): Promise<boolean>;
/**
* Make HTTP request with retry logic and error handling
*/
private makeRequest;
/**
* Parse error response from the INP platform
*/
private parseErrorResponse;
/**
* Create default logger
*/
private createDefaultLogger;
/**
* Sleep utility for retry delays
*/
private sleep;
}
//# sourceMappingURL=inp-client.d.ts.map