(
key: IntegrationTaskKey,
callback: (client: AirtableSDK, task: IOTask, io: IO) => Promise<TResult>,
options?: RunTaskOptions,
errorCallback?: RunTaskErrorCallback
)
| 85 | } |
| 86 | |
| 87 | runTask<T, TResult extends Json<T> | void>( |
| 88 | key: IntegrationTaskKey, |
| 89 | callback: (client: AirtableSDK, task: IOTask, io: IO) => Promise<TResult>, |
| 90 | options?: RunTaskOptions, |
| 91 | errorCallback?: RunTaskErrorCallback |
| 92 | ): Promise<TResult> { |
| 93 | if (!this._io) throw new Error("No IO"); |
| 94 | if (!this._connectionKey) throw new Error("No connection key"); |
| 95 | |
| 96 | return this._io.runTask( |
| 97 | key, |
| 98 | (task, io) => { |
| 99 | if (!this._client) throw new Error("No client"); |
| 100 | return callback(this._client, task, io); |
| 101 | }, |
| 102 | { |
| 103 | icon: "airtable", |
| 104 | retry: retry.standardBackoff, |
| 105 | ...(options ?? {}), |
| 106 | connectionKey: this._connectionKey, |
| 107 | }, |
| 108 | errorCallback ?? onError |
| 109 | ); |
| 110 | } |
| 111 | |
| 112 | base(baseId: string) { |
| 113 | return new Base(this.runTask.bind(this), baseId); |
no outgoing calls
no test coverage detected