Skip to content

Commit

Permalink
method_path -> endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Brord van Wierst committed Jul 5, 2023
1 parent 802f7ec commit 0db1794
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion bindings/core/src/method/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ pub enum ClientMethod {
CallPluginRoute {
base_plugin_path: String,
method: String,
method_path: String,
endpoint: String,
query_params: Vec<String>,
request_object: Option<String>,
},
Expand Down
4 changes: 2 additions & 2 deletions bindings/core/src/method_handler/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
6 changes: 3 additions & 3 deletions bindings/nodejs/lib/client/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1023,15 +1023,15 @@ 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.
*/
async callPluginRoute(
basePluginPath: string,
method: 'GET' | 'POST',
methodPath: string,
endpoint: string,
queryParams?: string[],
request?: string,
): Promise<string> {
Expand All @@ -1040,7 +1040,7 @@ export class Client {
data: {
basePluginPath,
method,
methodPath,
endpoint,
queryParams: queryParams ?? [],
request,
},
Expand Down
2 changes: 1 addition & 1 deletion bindings/nodejs/lib/types/client/bridge/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ export type __CallPluginRouteMethod__ = {
data: {
basePluginPath: string;
method: 'GET' | 'POST';
methodPath: string;
endpoint: string;
queryParams: string[];
request?: string;
};
Expand Down
4 changes: 2 additions & 2 deletions bindings/python/iota_sdk/client/_node_core_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,15 @@ 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:
query_params = []
return self._call_method('callPluginRoute', {
'basePluginPath': base_plugin_path,
'method': method,
'methodPath': method_path,
'endpoint': endpoint,
'queryParams': query_params,
'request': request,
})
4 changes: 2 additions & 2 deletions sdk/src/client/node_api/plugin/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ impl ClientInner {
&self,
base_plugin_path: &str,
method: &str,
method_path: &str,
endpoint: &str,
query_params: Vec<String>,
request_object: Option<String>,
) -> Result<T>
Expand All @@ -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 {
Expand Down

0 comments on commit 0db1794

Please sign in to comment.