---
title: Requests
source: https://infrared.city/docs/sdk/1.0/api/typescript/requests/
---

# Requests

<a id="analysesname"></a>

## AnalysesName

Import from `@infrared-city/infrared-sdk-ts`.

> **AnalysesName** = *typeof* [`AnalysesName`](requests.md#analysesname)\[keyof *typeof* [`AnalysesName`](requests.md#analysesname)\]

The union of the analysis name strings in the `AnalysesName` constant, for
example `"wind-speed"` or `"daylight-factor"`.


> `const` **AnalysesName**: `object`

The analysis names the API accepts, as the value of a request's
`analysisType`: `AnalysesName.WindSpeed` is `"wind-speed"`, and so on for
each analysis.

### Type Declaration

| Name | Type | Default value |
| ------ | ------ | ------ |
| <a id="analysesname-daylightavailability"></a> `DaylightAvailability` | `"daylight-availability"` | `"daylight-availability"` |
| <a id="analysesname-daylightfactor"></a> `DaylightFactor` | `"daylight-factor"` | `"daylight-factor"` |
| <a id="analysesname-directsunhours"></a> `DirectSunHours` | `"direct-sun-hours"` | `"direct-sun-hours"` |
| <a id="analysesname-pedestrianwindcomfort"></a> `PedestrianWindComfort` | `"pedestrian-wind-comfort"` | `"pedestrian-wind-comfort"` |
| <a id="analysesname-skyviewfactors"></a> `SkyViewFactors` | `"sky-view-factors"` | `"sky-view-factors"` |
| <a id="analysesname-solarradiation"></a> `SolarRadiation` | `"solar-radiation"` | `"solar-radiation"` |
| <a id="analysesname-thermalcomfortindex"></a> `ThermalComfortIndex` | `"thermal-comfort-index"` | `"thermal-comfort-index"` |
| <a id="analysesname-thermalcomfortstatistics"></a> `ThermalComfortStatistics` | `"thermal-comfort-statistics"` | `"thermal-comfort-statistics"` |
| <a id="analysesname-windspeed"></a> `WindSpeed` | `"wind-speed"` | `"wind-speed"` |

***

<a id="binaryacknowledgement"></a>

## BinaryAcknowledgement

Import from `@infrared-city/infrared-sdk-ts`.

The service's acknowledgement of a binary submission, carried on the `Job`.

### Properties

| Property | Modifier | Type | Description |
| ------ | ------ | ------ | ------ |
| <a id="binaryacknowledgement-artifactdigest"></a> `artifactDigest` | `readonly` | `string` | Digest of the submitted artifact. |
| <a id="binaryacknowledgement-contentdigest"></a> `contentDigest` | `readonly` | `string` | Digest of the submitted content. |
| <a id="binaryacknowledgement-inputformat"></a> `inputFormat` | `readonly` | `"irbf"` | Input format the service accepted. |
| <a id="binaryacknowledgement-resultformat"></a> `resultFormat` | `readonly` | `"irbf"` \| `"json"` | Format the results will be returned in. |
| <a id="binaryacknowledgement-wireversion"></a> `wireVersion` | `readonly` | `1` | Version of the binary wire format. |

***

<a id="binarycapability"></a>

## BinaryCapability

Import from `@infrared-city/infrared-sdk-ts`.

What the service accepts on its binary route: formats, models and limits.

### Properties

| Property | Type | Description |
| ------ | ------ | ------ |
| <a id="binarycapability-facadetargets"></a> `facadeTargets?` | `number` | Present when the service reads a job's `targets` range; when absent, each job has its own frame. |
| <a id="binarycapability-geometryschemas"></a> `geometrySchemas?` | readonly `number`\[\] | The geometry document versions the service reads; when absent, only `1`. |
| <a id="binarycapability-inputformat"></a> `inputFormat` | `"irbf"` | - |
| <a id="binarycapability-limits"></a> `limits` | [`BinaryLimits`](requests.md#binarylimits) | - |
| <a id="binarycapability-models"></a> `models` | `Record`&lt;`string`, \{ `geometryGroups`: `string`\[\]; `resultFamilies`: `string`\[\]; \}&gt; | - |
| <a id="binarycapability-resultformat"></a> `resultFormat` | `"irbf"` | - |
| <a id="binarycapability-wireversion"></a> `wireVersion` | `1` | - |

***

<a id="binarylimits"></a>

## BinaryLimits

Import from `@infrared-city/infrared-sdk-ts`.

The size limits the service sets for a binary request and its result.

### Properties

| Property | Type |
| ------ | ------ |
| <a id="binarylimits-maxgeometrybytes"></a> `maxGeometryBytes` | `number` |
| <a id="binarylimits-maxinstances"></a> `maxInstances` | `number` |
| <a id="binarylimits-maxmeshes"></a> `maxMeshes` | `number` |
| <a id="binarylimits-maxmetadatabytes"></a> `maxMetadataBytes` | `number` |
| <a id="binarylimits-maxresultbytes"></a> `maxResultBytes` | `number` |
| <a id="binarylimits-maxresultcells"></a> `maxResultCells` | `number` |
| <a id="binarylimits-maxtrianglevalues"></a> `maxTriangleValues` | `number` |

***

<a id="downloadresultsoptions"></a>

## DownloadResultsOptions

Import from `@infrared-city/infrared-sdk-ts`.

Options for downloading a job's results.

### Properties

| Property | Modifier | Type | Description |
| ------ | ------ | ------ | ------ |
| <a id="downloadresultsoptions-job"></a> `job?` | `readonly` | [`Job`](run-an-analysis.md#job) | A job you already fetched; its status is then not read again. |
| <a id="downloadresultsoptions-signal"></a> `signal?` | `readonly` | `AbortSignal` | Cancels the download. |

***

<a id="jobfromresponse"></a>

## jobFromResponse

Import from `@infrared-city/infrared-sdk-ts`.

> **jobFromResponse**(`input`): [`Job`](run-an-analysis.md#job)

Convert a job object returned by the API into a [Job](run-an-analysis.md#job).

### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `input` | `unknown` | The parsed JSON of one job response. |

### Returns

[`Job`](run-an-analysis.md#job)

The job, with optional fields present only when the API sent them.

### Throws

If `input` is not an object, has no `jobId`, or carries an invalid
  binary acknowledgement.

***

<a id="onpollcallback"></a>

## OnPollCallback

Import from `@infrared-city/infrared-sdk-ts`.

> **OnPollCallback** = (`job`, `attempt`, `elapsed`, `nextDelay`) => `boolean` \| `void` \| `Promise`&lt;`boolean` \| `void`&gt;

Callback invoked after every job status read while waiting for a job.

It receives the latest `Job`, the attempt number, the seconds elapsed so far
and the seconds until the next status read. Return `false` to stop waiting;
the job is then returned as it is. Any other return value keeps waiting. An
error thrown by the callback does not stop the wait.

### Parameters

| Parameter | Type |
| ------ | ------ |
| `job` | [`Job`](run-an-analysis.md#job) |
| `attempt` | `number` |
| `elapsed` | `number` |
| `nextDelay` | `number` |

### Returns

`boolean` \| `void` \| `Promise`&lt;`boolean` \| `void`&gt;

***

<a id="parsejobstatus"></a>

## parseJobStatus

Import from `@infrared-city/infrared-sdk-ts`.

> **parseJobStatus**(`value`): [`JobStatus`](run-an-analysis.md#jobstatus)

Convert the status text of a job response into a [JobStatus](run-an-analysis.md#jobstatus).

Matching ignores case. Any text that is not a known status gives `"unknown"`.

### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `value` | `string` | The status text from the API. |

### Returns

[`JobStatus`](run-an-analysis.md#jobstatus)

The matching status.

***

<a id="physics_tiers"></a>

## PHYSICS_TIERS

Import from `@infrared-city/infrared-sdk-ts`.

> `const` **PHYSICS\_TIERS**: readonly \[`"v1"`, `"detail"`, `"advanced"`, `"advanced-moist"`\]

The accepted values of `physics`, the sky and mean-radiant-temperature formulation of a
thermal run. The set is closed: any other value is refused before the request is sent.

Leave `physics` unset to get the model's own default, `advanced-moist`. On
`thermal-comfort-index`, `"v1"` and `"detail"` are deprecated: they still run, with one
warning per value per process. On `thermal-comfort-statistics`, `"detail"` is rejected before
submit. New code should leave `physics` unset or use `"advanced"` or `"advanced-moist"`. A
later release will remove `"v1"` and `"detail"`.

***

<a id="physicstier"></a>

## PhysicsTier

Import from `@infrared-city/infrared-sdk-ts`, `@infrared-city/infrared-sdk-ts/tiling`.

> **PhysicsTier** = *typeof* [`PHYSICS_TIERS`](requests.md#physics_tiers)\[`number`\]

One of the values in `PHYSICS_TIERS`.

***

<a id="serializetokebab"></a>

## serializeToKebab

Import from `@infrared-city/infrared-sdk-ts`.

> **serializeToKebab**(`value`): `unknown`

Converts a request object with camelCase keys to the kebab-case keys the
API expects, recursively. Fields that are `null` or `undefined` are
dropped, and the ids inside entity maps such as `geometries`,
`vegetation` and `groundMaterials` are kept exactly as given.

### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `value` | `unknown` | The request object, or any value found inside one. |

### Returns

`unknown`

A converted copy; values that are not plain objects or arrays are returned as they are.

***

<a id="setownkey"></a>

## setOwnKey

Import from `@infrared-city/infrared-sdk-ts`.

> **setOwnKey**(`target`, `key`, `value`): `void`

Sets an enumerable property directly on `target`, even when `key` is a
name such as `__proto__` that a plain assignment would treat specially.

### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `target` | `Record`&lt;`string`, `unknown`&gt; | The object to change. |
| `key` | `string` | The property name. |
| `value` | `unknown` | The value to store. |

### Returns

`void`

***

<a id="submitoptions"></a>

## SubmitOptions

Import from `@infrared-city/infrared-sdk-ts`.

Options for submitting a single job.

### Properties

| Property | Modifier | Type | Description |
| ------ | ------ | ------ | ------ |
| <a id="submitoptions-signal"></a> `signal?` | `readonly` | `AbortSignal` | Cancels the submission. |
| <a id="submitoptions-transport"></a> `transport?` | `readonly` | `"json"` \| `"binary"` | Transport for the request body: `"binary"` or `"json"`. When unset, binary is used, or JSON for an analysis that has no binary route. |
| <a id="submitoptions-webhookevents"></a> `webhookEvents?` | `readonly` | readonly `string`\[\] | Job events that trigger a notification to `webhookUrl`. |
| <a id="submitoptions-webhookurl"></a> `webhookUrl?` | `readonly` | `string` | URL that receives webhook notifications for the job. |

***

<a id="thermal_controls"></a>

## THERMAL_CONTROLS

Import from `@infrared-city/infrared-sdk-ts`.

> `const` **THERMAL\_CONTROLS**: readonly \[`"physics"`, `"wallAlbedo"`, `"wallAbsorptivity"`, `"canopyTransmissivity"`, `"groundAlbedo"`, `"groundDtMax"`\]

The six global thermal controls: `physics`, `wallAlbedo`, `wallAbsorptivity`,
`canopyTransmissivity`, `groundAlbedo` and `groundDtMax`.

They are valid only on `thermal-comfort-index` and `thermal-comfort-statistics`, and are
top-level request fields, at the same level as `subtype` and `analysis-type`, not nested
under any sub-object. Passing one to any other analysis is refused.

***

<a id="tocamelcase"></a>

## toCamelCase

Import from `@infrared-city/infrared-sdk-ts`.

> **toCamelCase**(`value`): `string`

Converts a snake_case or kebab-case name to camelCase, for example
`"wind-speed"` to `"windSpeed"`.

### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `value` | `string` | The name to convert. |

### Returns

`string`

The camelCase name.

***

<a id="tokebabcase"></a>

## toKebabCase

Import from `@infrared-city/infrared-sdk-ts`.

> **toKebabCase**(`value`): `string`

Converts a camelCase or snake_case name to kebab-case, for example
`"windSpeed"` to `"wind-speed"`.

### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `value` | `string` | The name to convert. |

### Returns

`string`

The lower-case, hyphen-separated name.

***

<a id="waitforcompletionoptions"></a>

## WaitForCompletionOptions

Import from `@infrared-city/infrared-sdk-ts`.

Options for waiting for a job to finish.

### Properties

| Property | Modifier | Type | Description |
| ------ | ------ | ------ | ------ |
| <a id="waitforcompletionoptions-onpoll"></a> `onPoll?` | `readonly` | [`OnPollCallback`](requests.md#onpollcallback) | Called after every status read; return `false` to stop waiting. |
| <a id="waitforcompletionoptions-signal"></a> `signal?` | `readonly` | `AbortSignal` | Cancels the wait. |
| <a id="waitforcompletionoptions-timeout"></a> `timeout?` | `readonly` | `number` | Longest time to wait, in seconds. Default 900. |

***

<a id="wind_analysis_types"></a>

## WIND_ANALYSIS_TYPES

Import from `@infrared-city/infrared-sdk-ts`.

> `const` **WIND\_ANALYSIS\_TYPES**: `ReadonlySet`&lt;[`AnalysesName`](requests.md#analysesname)&gt;

The wind analyses: `wind-speed` and `pedestrian-wind-comfort`.

***

<a id="wireanalysisrequest"></a>

## WireAnalysisRequest

Import from `@infrared-city/infrared-sdk-ts`.

> **WireAnalysisRequest** = `Readonly`&lt;`Record`&lt;`string`, `unknown`&gt;&gt; & `object`

An analysis request already written with the API's own keys (kebab-case),
the form `AnalysisService.execute` takes. It must have an `"analysis-type"`
string.

### Type Declaration

| Name | Type |
| ------ | ------ |
| `analysis-type` | `string` |

***
