Skip to content
Snippets Groups Projects
Unverified Commit f51b52cc authored by Mateu Aguiló Bosch's avatar Mateu Aguiló Bosch
Browse files

fix: remove unnecessary API and dependencies

parent b90c0c54
No related branches found
No related tags found
No related merge requests found
{
"name": "drupal/api_proxy",
"description": "Puts Drupal between the front-end and the 3rd party API.",
"type": "drupal-module",
"homepage": "https://drupal.org/project/api_proxy",
"support": {
"issues": "https://drupal.org/project/issues/api_proxy",
"source": "https://git.drupalcode.org/project/api_proxy"
},
"license": "GPL-2.0+",
"minimum-stability": "dev",
"require": {
"lstrojny/functional-php": "^1.9"
}
}
...@@ -14,7 +14,6 @@ interface HttpApiInterface { ...@@ -14,7 +14,6 @@ interface HttpApiInterface {
public function shouldForwardQueryStingParams(): bool; public function shouldForwardQueryStingParams(): bool;
public function getAdditionalHeaders(): array; public function getAdditionalHeaders(): array;
public function getAdditionalQueryStringParams(): array; public function getAdditionalQueryStringParams(): array;
public function getTimeout(): ?int;
public function isCacheForced(): int; public function isCacheForced(): int;
public function getForcedCacheTtl(): int; public function getForcedCacheTtl(): int;
public function changeInputToDrupal(Request $request): Request; public function changeInputToDrupal(Request $request): Request;
......
...@@ -100,7 +100,6 @@ abstract class HttpApiPluginBase extends PluginBase implements ContainerFactoryP ...@@ -100,7 +100,6 @@ abstract class HttpApiPluginBase extends PluginBase implements ContainerFactoryP
'forwardQueryStingParams' => FALSE, 'forwardQueryStingParams' => FALSE,
'additionalHeaders' => [], 'additionalHeaders' => [],
'additionalQueryStringParams' => [], 'additionalQueryStringParams' => [],
'timeout' => NULL,
'forceCache' => FALSE, 'forceCache' => FALSE,
'forcedCacheTtl' => 3 * 60, 'forcedCacheTtl' => 3 * 60,
'cors' => [ 'cors' => [
...@@ -147,13 +146,6 @@ abstract class HttpApiPluginBase extends PluginBase implements ContainerFactoryP ...@@ -147,13 +146,6 @@ abstract class HttpApiPluginBase extends PluginBase implements ContainerFactoryP
return $this->getConfiguration()['additionalQueryStringParams']; return $this->getConfiguration()['additionalQueryStringParams'];
} }
/**
* {@inheritdoc}
*/
public function getTimeout(): ?int {
return $this->getConfiguration()['timeout'];
}
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
...@@ -243,12 +235,6 @@ abstract class HttpApiPluginBase extends PluginBase implements ContainerFactoryP ...@@ -243,12 +235,6 @@ abstract class HttpApiPluginBase extends PluginBase implements ContainerFactoryP
'#description' => $this->t('Additional query string parameters to send to the 3rd party API. Add one parameter per line. Separate parameter name and value with a "=". Example: <code>include[rating][foo][]=6</code>.'), '#description' => $this->t('Additional query string parameters to send to the 3rd party API. Add one parameter per line. Separate parameter name and value with a "=". Example: <code>include[rating][foo][]=6</code>.'),
'#default_value' => implode("\n", $lines), '#default_value' => implode("\n", $lines),
]; ];
$form[$plugin_id]['timeout'] = [
'#type' => 'number',
'#title' => $this->t('Timeout'),
'#description' => $this->t('Fail the request to the 3rd party HTTP API after this many seconds.'),
'#default_value' => $this->getTimeout(),
];
$form[$plugin_id]['forceCache'] = [ $form[$plugin_id]['forceCache'] = [
'#type' => 'checkbox', '#type' => 'checkbox',
'#title' => $this->t('Force response caching'), '#title' => $this->t('Force response caching'),
...@@ -322,7 +308,6 @@ abstract class HttpApiPluginBase extends PluginBase implements ContainerFactoryP ...@@ -322,7 +308,6 @@ abstract class HttpApiPluginBase extends PluginBase implements ContainerFactoryP
$values['additionalQueryStringParams'] $values['additionalQueryStringParams']
); );
$values['cors']['origin'] = $this->parseMultiline($values['cors']['origin']); $values['cors']['origin'] = $this->parseMultiline($values['cors']['origin']);
$values['timeout'] = $values['timeout'] ?: NULL;
$this->setConfiguration($values + $this->configuration); $this->setConfiguration($values + $this->configuration);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment