# Interface: MockExecutionContext

Defined in: [testing/mocks.ts:20](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/testing/mocks.ts#L20)

An object passed to the `execute` function of every formula invocation with information and utilities for handling the invocation. In particular, this contains the [core.Fetcher](../../../core/interfaces/Fetcher/), which is used for making HTTP requests.

## Extends

- [`ExecutionContext`](../../../core/interfaces/ExecutionContext/)

## Extended by

- [`MockSyncExecutionContext`](../MockSyncExecutionContext/)

## Properties

### endpoint?

> `readonly` `optional` **endpoint**: `string`

Defined in: [api_types.ts:1230](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/api_types.ts#L1230)

The base endpoint URL for the user's account, only if applicable. See [core.BaseAuthentication.requiresEndpointUrl](../../../core/interfaces/BaseAuthentication/#requiresendpointurl).

If the API URLs are variable based on the user account, you will need this endpoint to construct URLs to use with the fetcher. Alternatively, you can use relative URLs (e.g. "/api/entity") and the platform will include the endpoint for you automatically.

#### Inherited from

[`ExecutionContext`](../../../core/interfaces/ExecutionContext/).[`endpoint`](../../../core/interfaces/ExecutionContext/#endpoint)

______________________________________________________________________

### fetcher

> **fetcher**: `object`

Defined in: [testing/mocks.ts:21](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/testing/mocks.ts#L21)

The [core.Fetcher](../../../core/interfaces/Fetcher/) used for making HTTP requests.

#### fetch

> **fetch**: `SinonStub`\<\[[`FetchRequest`](../../../core/interfaces/FetchRequest/)\], `Promise`\<[`FetchResponse`](../../../core/interfaces/FetchResponse/)\<`any`>>>

#### Overrides

[`ExecutionContext`](../../../core/interfaces/ExecutionContext/).[`fetcher`](../../../core/interfaces/ExecutionContext/#fetcher)

______________________________________________________________________

### invocationLocation

> `readonly` **invocationLocation**: [`InvocationLocation`](../../../core/interfaces/InvocationLocation/)

Defined in: [api_types.ts:1235](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/api_types.ts#L1235)

Information about the environment and doc this formula was invoked from. This is mostly for internal use and we do not recommend relying on it.

#### Inherited from

[`ExecutionContext`](../../../core/interfaces/ExecutionContext/).[`invocationLocation`](../../../core/interfaces/ExecutionContext/#invocationlocation)

______________________________________________________________________

### invocationToken

> `readonly` **invocationToken**: `string`

Defined in: [api_types.ts:1246](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/api_types.ts#L1246)

A random token scoped to only this request invocation. This is a unique identifier for the invocation, and in particular used with [core.AuthenticationType.Custom](../../../core/enumerations/AuthenticationType/#custom) for naming template parameters that will be replaced by the fetcher in secure way.

#### Inherited from

[`ExecutionContext`](../../../core/interfaces/ExecutionContext/).[`invocationToken`](../../../core/interfaces/ExecutionContext/#invocationtoken)

______________________________________________________________________

### previousAttemptError?

> `readonly` `optional` **previousAttemptError**: [`InvocationError`](../../../core/type-aliases/InvocationError/)

Defined in: [api_types.ts:1270](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/api_types.ts#L1270)

If this invocation is a retry, this will be populated with information about what went wrong during the previous attempt. If an error occurs while indexing a sync table, it will retried again later. This field is only applicable for sync tables used within Superhuman Go agents.

#### Inherited from

[`ExecutionContext`](../../../core/interfaces/ExecutionContext/).[`previousAttemptError`](../../../core/interfaces/ExecutionContext/#previousattempterror)

______________________________________________________________________

### sync?

> `readonly` `optional` **sync**: [`Sync`](../../../core/type-aliases/Sync/)\<`unknown`, `unknown`, `unknown`>

Defined in: [api_types.ts:1250](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/api_types.ts#L1250)

Information about state of the current sync. Only populated if this is a sync table formula.

#### Inherited from

[`ExecutionContext`](../../../core/interfaces/ExecutionContext/).[`sync`](../../../core/interfaces/ExecutionContext/#sync)

______________________________________________________________________

### temporaryBlobStorage

> **temporaryBlobStorage**: `object`

Defined in: [testing/mocks.ts:24](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/testing/mocks.ts#L24)

A utility to fetch and store files and images that either require the pack user's authentication or are too large to return inline. See [core.TemporaryBlobStorage](../../../core/interfaces/TemporaryBlobStorage/).

#### storeBlob

> **storeBlob**: `SinonStub`\<\[`Buffer`, `string`, `object`\]>

#### storeUrl

> **storeUrl**: `SinonStub`\<\[`string`, `object`, `Pick`\<[`FetchRequest`](../../../core/interfaces/FetchRequest/), `"headers"` | `"cacheTtlSecs"` | `"disableAuthentication"`>\]>

#### Overrides

[`ExecutionContext`](../../../core/interfaces/ExecutionContext/).[`temporaryBlobStorage`](../../../core/interfaces/ExecutionContext/#temporaryblobstorage)

______________________________________________________________________

### timezone

> `readonly` **timezone**: `string`

Defined in: [api_types.ts:1239](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/api_types.ts#L1239)

The timezone of the doc from which this formula was invoked.

#### Inherited from

[`ExecutionContext`](../../../core/interfaces/ExecutionContext/).[`timezone`](../../../core/interfaces/ExecutionContext/#timezone)
