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