mirror of
https://github.com/avency/Gitea.git
synced 2025-10-29 10:42:33 +01:00
Merge branch 'feature/mg-Defaults' of AVENCY/Gitea into master
Reviewed-by: Lisa Kampert <lisa.kampert@avency.de>
This commit is contained in:
@ -26,6 +26,47 @@ class Miscellaneous implements EndpointInterface
|
|||||||
$this->client = $client;
|
$this->client = $client;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string|null $text
|
||||||
|
* @param string|null $context
|
||||||
|
* @param string|null $mode
|
||||||
|
* @param bool $wiki
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function markdown(string $text = null, string $context = null, string $mode = null, bool $wiki = true): string
|
||||||
|
{
|
||||||
|
$options['json'] = [
|
||||||
|
'context' => $context,
|
||||||
|
'mode' => $mode,
|
||||||
|
'text' => $text,
|
||||||
|
'wiki' => $wiki
|
||||||
|
];
|
||||||
|
$options['json'] = array_filter($options['json']);
|
||||||
|
|
||||||
|
$response = $this->client->request(self::BASE_URI . '/markdown', 'POST', $options);
|
||||||
|
return (string)$response->getBody();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string$text
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function markdownRaw(string $text): string
|
||||||
|
{
|
||||||
|
$options['body'] = $text;
|
||||||
|
$response = $this->client->request(self::BASE_URI . '/markdown/raw', 'POST', $options);
|
||||||
|
return (string)$response->getBody();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function signingKeyGPG(): string
|
||||||
|
{
|
||||||
|
$response = $this->client->request(self::BASE_URI . '/signing-key.gpg');
|
||||||
|
return (string)$response->getBody();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -95,9 +95,9 @@ Status | Method | Endpoint
|
|||||||
|
|
||||||
Status | Method | Endpoint
|
Status | Method | Endpoint
|
||||||
--- | --- | ---
|
--- | --- | ---
|
||||||
❌ | POST | /markdown
|
✅ | POST | /markdown
|
||||||
❌ | POST | /markdown/raw
|
✅ | POST | /markdown/raw
|
||||||
❌ | GET | /signing-key.gpg
|
✅ | GET | /signing-key.gpg
|
||||||
✅ | GET | /version
|
✅ | GET | /version
|
||||||
|
|
||||||
#### Organization
|
#### Organization
|
||||||
|
|||||||
Reference in New Issue
Block a user