Invoke a hook on the plugin.
(
&self,
hook: &str,
input: Value,
output: Value,
)
| 213 | |
| 214 | /// Invoke a hook on the plugin. |
| 215 | pub async fn invoke_hook( |
| 216 | &self, |
| 217 | hook: &str, |
| 218 | input: Value, |
| 219 | output: Value, |
| 220 | ) -> Result<Value, PluginSubprocessError> { |
| 221 | let params = serde_json::json!({ |
| 222 | "hook": hook, |
| 223 | "input": input, |
| 224 | "output": output, |
| 225 | }); |
| 226 | let result: Value = self.call("hook.invoke", Some(params)).await?; |
| 227 | Ok(result.get("output").cloned().unwrap_or(Value::Null)) |
| 228 | } |
| 229 | |
| 230 | /// Trigger OAuth authorization flow. |
| 231 | pub async fn auth_authorize( |
no test coverage detected