Class: HttpClient
Prefactor TypeScript SDK / @prefactor/core / HttpClient
Class: HttpClient
Section titled “Class: HttpClient”Defined in: packages/core/src/transport/http/http-client.ts:53
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new HttpClient(
config,dependencies?):HttpClient
Defined in: packages/core/src/transport/http/http-client.ts:65
Parameters
Section titled “Parameters”config
Section titled “config”apiUrl
Section titled “apiUrl”string = ...
API endpoint URL
apiToken
Section titled “apiToken”string = ...
Authentication token
agentIdentifier
Section titled “agentIdentifier”string = ...
Agent identifier (external identifier); defaults to v1.0.0 when omitted
requestTimeout
Section titled “requestTimeout”number = ...
Request timeout in milliseconds
maxRetries
Section titled “maxRetries”number = ...
Maximum number of retry attempts
initialRetryDelay
Section titled “initialRetryDelay”number = ...
Initial delay between retries in milliseconds
maxRetryDelay
Section titled “maxRetryDelay”number = ...
Maximum delay between retries in milliseconds
retryMultiplier
Section titled “retryMultiplier”number = ...
Multiplier for exponential backoff
retryOnStatusCodes
Section titled “retryOnStatusCodes”number[] = ...
Status codes that should trigger retries
agentId?
Section titled “agentId?”string = ...
Optional agent instance identifier (internal ID)
agentName?
Section titled “agentName?”string = ...
Optional agent name
agentDescription?
Section titled “agentDescription?”string = ...
Optional agent description
agentSchema?
Section titled “agentSchema?”Record<string, unknown> = ...
Optional agent schema for validation (full schema object)
dependencies?
Section titled “dependencies?”HttpClientDependencies
Returns
Section titled “Returns”HttpClient
Methods
Section titled “Methods”request()
Section titled “request()”request<
TResponse>(path,options?):Promise<TResponse>
Defined in: packages/core/src/transport/http/http-client.ts:80
Type Parameters
Section titled “Type Parameters”TResponse
Section titled “TResponse”TResponse = unknown
Parameters
Section titled “Parameters”string
options?
Section titled “options?”HttpRequestOptions = {}
Returns
Section titled “Returns”Promise<TResponse>