Skip to content

Interface: MockSyncExecutionContext<SyncContinuationT, IncrementalCheckpointContinuationT, IncrementalSyncContinuationT>

Defined in: testing/mocks.ts:30

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, which is used for making HTTP requests.

Extends

Type Parameters

Type Parameter Default type
SyncContinuationT Continuation
IncrementalCheckpointContinuationT SyncContinuationT
IncrementalSyncContinuationT SyncContinuationT

Properties

endpoint?

readonly optional endpoint: string

Defined in: api_types.ts:1122

The base endpoint URL for the user's account, only if applicable. See core.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 Coda will include the endpoint for you automatically.

Inherited from

MockExecutionContext.endpoint


fetcher

fetcher: object

Defined in: testing/mocks.ts:21

The core.Fetcher used for making HTTP requests.

fetch

fetch: SinonStub<[FetchRequest], Promise<FetchResponse<any>>>

Inherited from

MockExecutionContext.fetcher


invocationLocation

readonly invocationLocation: InvocationLocation

Defined in: api_types.ts:1127

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

Inherited from

MockExecutionContext.invocationLocation


invocationToken

readonly invocationToken: string

Defined in: api_types.ts:1138

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 for naming template parameters that will be replaced by the fetcher in secure way.

Inherited from

MockExecutionContext.invocationToken


sync

sync: Sync<SyncContinuationT, IncrementalCheckpointContinuationT, IncrementalSyncContinuationT>

Defined in: testing/mocks.ts:35

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

Overrides

MockExecutionContext.sync


syncStateService

syncStateService: object

Defined in: testing/mocks.ts:36

getLatestRowVersions

getLatestRowVersions: SinonStub<[string[]]>


temporaryBlobStorage

temporaryBlobStorage: object

Defined in: testing/mocks.ts:24

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.

storeBlob

storeBlob: SinonStub<[Buffer, string, object]>

storeUrl

storeUrl: SinonStub<[string, object, Pick<FetchRequest, "headers" | "cacheTtlSecs" | "disableAuthentication">]>

Inherited from

MockExecutionContext.temporaryBlobStorage


timezone

readonly timezone: string

Defined in: api_types.ts:1131

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

Inherited from

MockExecutionContext.timezone