import { RouteMetadata, LogApiCall } from '@webpieces/core-util'; import { ContextMgr, Secrets } from '@webpieces/core-util'; import { ApiPrototype, ClientConfig, IdTokenMinter } from './ClientConfig'; /** * ProxyClient - the HTTP call engine behind one API contract's client proxy. * * Built by {@link ClientHttpFactory} (one per API contract), it owns: * - @ApiPath validation + the route map built from the contract's decorators * - Making HTTP requests based on that route metadata * - Header propagation via ContextMgr * - Outbound delivery auth (@AuthOidc bearer / @AuthSharedSecret value) * - Logging via LogApiCall, and test-case recording * - Error translation via ClientErrorTranslator * * It is the @DocumentDesign design root for this package: its constructor params ARE * the client's dependency graph. Collaborators (contextMgr / idTokenMinter / secrets) * are injected by the factory; {@link ClientConfig} carries only per-client STATE. */ export declare class ProxyClient { private config; private contextMgr?; private idTokenMinter?; private secrets?; private logApiCall; private routeMap; private apiName; constructor(apiPrototype: ApiPrototype, config: ClientConfig, contextMgr?: ContextMgr | undefined, idTokenMinter?: IdTokenMinter | undefined, secrets?: Secrets | undefined, logApiCall?: LogApiCall); /** * Check if a route exists for the given method name. */ hasRoute(methodName: string): boolean; /** * Get route metadata for a method name. * @throws Error if no route found */ getRoute(methodName: string): RouteMetadata; /** * Attach the outbound credential for the endpoint's AuthMode: an @AuthOidc bearer minted as this * caller's runtime SA (audience = the callee base URL, via the injected gcp-identity minter — the * server verifies the signature + caller allow-list), or the @AuthSharedSecret(key) value THIS * client sends from its bound {@link Secrets}. Symmetric with the Cloud Tasks invokers; never * reads process.env. */ private attachOutboundAuth; /** * Make an HTTP request based on route metadata and arguments. * * All endpoints are POST-only. The request body is the first argument. */ makeRequest(route: RouteMetadata, args: any[]): Promise; /** * Find the active TestCaseRecorder via the injected ContextReader. * Uses the OPTIONAL readValue() so http-client stays free of Node imports; * browser readers simply don't implement it (no recording in browsers). */ private findRecorder; /** * Execute the call while recording it (args + masked ctx snapshot + result). */ private recordCall; /** * Execute the fetch request and handle response. */ private executeFetch; }