Skip to main content

Transport

ParallelModel TypeScript SDK


Class: Transport

Defined in: transport.ts:194

Authenticated HTTP transport for the ParallelModel core and authentication APIs.

Constructors​

Constructor​

new Transport(options): Transport

Defined in: transport.ts:204

Creates a Transport instance.

Parameters​

options​

DefaultParallelModelAuthenticationOptions

Configuration options for the client or operation.

Returns​

Transport

Properties​

authentication​

readonly authentication: DefaultParallelModelAuthentication

Defined in: transport.ts:198

Authentication value for this contract.


options​

readonly options: Required<DefaultParallelModelAuthenticationOptions>

Defined in: transport.ts:196

Configuration options for the client or operation.

Methods​

authRequest()​

authRequest(method, endpoint, form?, signal?): Promise<Response>

Defined in: transport.ts:215

Sends an authentication API request with retry handling for transport failures and transient HTTP errors.

Parameters​

method​

string

HTTP method used for the request.

endpoint​

string

Relative API endpoint path.

form?​

URLSearchParams

Optional URL-encoded authentication request body.

signal?​

AbortSignal

Optional abort signal used to cancel local waiting or HTTP requests.

Returns​

Promise<Response>

The successful authentication API HTTP response.


raw()​

raw(method, endpoint, body?, query?, headers?, timeout?, signal?, api?): Promise<Response>

Defined in: transport.ts:229

Sends an authenticated HTTP request and returns the successful raw Fetch response; retries once after HTTP 401 when configured.

Parameters​

method​

string

HTTP method used for the request.

endpoint​

string

Relative API endpoint path.

body?​

BodyInit

HTTP response body or request body, depending on the operation.

query?​

Query

Optional query-string parameters appended to the endpoint.

headers?​

HeadersInit

HTTP headers associated with the request or response.

timeout?​

number

HTTP request timeout in milliseconds; omit to use the transport default.

signal?​

AbortSignal

Optional abort signal used to cancel local waiting or HTTP requests.

api?​

"core" | "auth" = 'core'

API base to target: core or auth.

Returns​

Promise<Response>

The successful raw HTTP response.


send()​

send<T>(method, endpoint, payload?, query?, headers?, timeout?, signal?, api?): Promise<ParallelModelResponse<T>>

Defined in: transport.ts:244

Serializes a request payload, sends an authenticated HTTP request and decodes the response envelope.

Type Parameters​

T​

T = unknown

Type of the decoded response or algorithm parameter object, as specified by the signature.

Parameters​

method​

string

HTTP method used for the request.

endpoint​

string

Relative API endpoint path.

payload?​

unknown

Request data serialized as JSON unless it is FormData.

query?​

Query

Optional query-string parameters appended to the endpoint.

headers?​

HeadersInit

HTTP headers associated with the request or response.

timeout?​

number

HTTP request timeout in milliseconds; omit to use the transport default.

signal?​

AbortSignal

Optional abort signal used to cancel local waiting or HTTP requests.

api?​

"core" | "auth" = 'core'

API base to target: core or auth.

Returns​

Promise<ParallelModelResponse<T>>

The decoded HTTP response envelope.