(
key: IntegrationTaskKey,
callback: (client: PlainClient, task: IOTask, io: IO) => Promise<TResult>,
options?: RunTaskOptions,
errorCallback?: RunTaskErrorCallback
)
| 73 | } |
| 74 | |
| 75 | runTask<T, TResult extends Json<T> | void>( |
| 76 | key: IntegrationTaskKey, |
| 77 | callback: (client: PlainClient, task: IOTask, io: IO) => Promise<TResult>, |
| 78 | options?: RunTaskOptions, |
| 79 | errorCallback?: RunTaskErrorCallback |
| 80 | ): Promise<TResult> { |
| 81 | if (!this._io) throw new Error("No IO"); |
| 82 | if (!this._connectionKey) throw new Error("No connection key"); |
| 83 | return this._io.runTask( |
| 84 | key, |
| 85 | (task, io) => { |
| 86 | if (!this._client) throw new Error("No client"); |
| 87 | return callback(this._client, task, io); |
| 88 | }, |
| 89 | { |
| 90 | icon: "plain", |
| 91 | retry: retry.standardBackoff, |
| 92 | ...(options ?? {}), |
| 93 | connectionKey: this._connectionKey, |
| 94 | }, |
| 95 | errorCallback |
| 96 | ); |
| 97 | } |
| 98 | |
| 99 | getCustomerById( |
| 100 | key: IntegrationTaskKey, |
no outgoing calls
no test coverage detected