From 0db1794f9c2bd7816075f5c1dc28960d15c9c849 Mon Sep 17 00:00:00 2001 From: Brord van Wierst Date: Wed, 5 Jul 2023 16:27:10 +0200 Subject: [PATCH] method_path -> endpoint --- bindings/core/src/method/client.rs | 2 +- bindings/core/src/method_handler/client.rs | 4 ++-- bindings/nodejs/lib/client/client.ts | 6 +++--- bindings/nodejs/lib/types/client/bridge/client.ts | 2 +- bindings/python/iota_sdk/client/_node_core_api.py | 4 ++-- sdk/src/client/node_api/plugin/mod.rs | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/bindings/core/src/method/client.rs b/bindings/core/src/method/client.rs index 3da92c7dca..2bac83685a 100644 --- a/bindings/core/src/method/client.rs +++ b/bindings/core/src/method/client.rs @@ -130,7 +130,7 @@ pub enum ClientMethod { CallPluginRoute { base_plugin_path: String, method: String, - method_path: String, + endpoint: String, query_params: Vec, request_object: Option, }, diff --git a/bindings/core/src/method_handler/client.rs b/bindings/core/src/method_handler/client.rs index 1ed7b0ff4d..dc2ceb840d 100644 --- a/bindings/core/src/method_handler/client.rs +++ b/bindings/core/src/method_handler/client.rs @@ -462,12 +462,12 @@ pub(crate) async fn call_client_method_internal(client: &Client, method: ClientM ClientMethod::CallPluginRoute { base_plugin_path, method, - method_path, + endpoint, query_params, request_object, } => { let data: serde_json::Value = client - .call_plugin_route(&base_plugin_path, &method, &method_path, query_params, request_object) + .call_plugin_route(&base_plugin_path, &method, &endpoint, query_params, request_object) .await?; Response::CustomJson(data) } diff --git a/bindings/nodejs/lib/client/client.ts b/bindings/nodejs/lib/client/client.ts index 3cc542c9d4..893e25a270 100644 --- a/bindings/nodejs/lib/client/client.ts +++ b/bindings/nodejs/lib/client/client.ts @@ -1023,7 +1023,7 @@ export class Client { * Extension method which provides request methods for plugins. * @param basePluginPath The base path for the plugin eg indexer/v1/ . * @param method The http method. - * @param methodPath The path for the plugin request. + * @param endpoint The path for the plugin request. * @param queryParams Additional query params for the request. * @param request The request object. * @returns The response json. @@ -1031,7 +1031,7 @@ export class Client { async callPluginRoute( basePluginPath: string, method: 'GET' | 'POST', - methodPath: string, + endpoint: string, queryParams?: string[], request?: string, ): Promise { @@ -1040,7 +1040,7 @@ export class Client { data: { basePluginPath, method, - methodPath, + endpoint, queryParams: queryParams ?? [], request, }, diff --git a/bindings/nodejs/lib/types/client/bridge/client.ts b/bindings/nodejs/lib/types/client/bridge/client.ts index c75ed6d4f3..d266072461 100644 --- a/bindings/nodejs/lib/types/client/bridge/client.ts +++ b/bindings/nodejs/lib/types/client/bridge/client.ts @@ -437,7 +437,7 @@ export type __CallPluginRouteMethod__ = { data: { basePluginPath: string; method: 'GET' | 'POST'; - methodPath: string; + endpoint: string; queryParams: string[]; request?: string; }; diff --git a/bindings/python/iota_sdk/client/_node_core_api.py b/bindings/python/iota_sdk/client/_node_core_api.py index c4eabf5c06..37d2c40430 100644 --- a/bindings/python/iota_sdk/client/_node_core_api.py +++ b/bindings/python/iota_sdk/client/_node_core_api.py @@ -165,7 +165,7 @@ def get_included_block_metadata(self, transaction_id: HexStr) -> BlockMetadata: 'transactionId': transaction_id })) - def call_plugin_route(self, base_plugin_path: str, method: str, method_path: str, query_params: [str] = None, request: str = None): + def call_plugin_route(self, base_plugin_path: str, method: str, endpoint: str, query_params: [str] = None, request: str = None): """Extension method which provides request methods for plugins. """ if query_params is None: @@ -173,7 +173,7 @@ def call_plugin_route(self, base_plugin_path: str, method: str, method_path: str return self._call_method('callPluginRoute', { 'basePluginPath': base_plugin_path, 'method': method, - 'methodPath': method_path, + 'endpoint': endpoint, 'queryParams': query_params, 'request': request, }) diff --git a/sdk/src/client/node_api/plugin/mod.rs b/sdk/src/client/node_api/plugin/mod.rs index 85474b8aa5..aa7260a8f4 100644 --- a/sdk/src/client/node_api/plugin/mod.rs +++ b/sdk/src/client/node_api/plugin/mod.rs @@ -15,7 +15,7 @@ impl ClientInner { &self, base_plugin_path: &str, method: &str, - method_path: &str, + endpoint: &str, query_params: Vec, request_object: Option, ) -> Result @@ -28,7 +28,7 @@ impl ClientInner { let req_method = reqwest::Method::from_str(&method); let node_manager = self.node_manager.read().await; - let path = format!("{}{}{}", base_plugin_path, method_path, query_params.join("&")); + let path = format!("{}{}{}", base_plugin_path, endpoint, query_params.join("&")); let timeout = self.get_timeout().await; match req_method {