2016-07-19 18:07:59 +03:00
|
|
|
<?php
|
2017-10-12 11:13:20 +03:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2017-07-15 10:00:53 +03:00
|
|
|
use Fig\Http\Message\RequestMethodInterface as RequestMethod;
|
2017-10-12 11:13:20 +03:00
|
|
|
use Shlinkio\Shlink\Rest\Action;
|
2016-07-19 18:07:59 +03:00
|
|
|
|
|
|
|
return [
|
|
|
|
|
|
|
|
'routes' => [
|
|
|
|
[
|
2017-07-07 14:12:45 +03:00
|
|
|
'name' => Action\AuthenticateAction::class,
|
2016-10-22 19:46:53 +03:00
|
|
|
'path' => '/rest/v{version:1}/authenticate',
|
2016-07-27 21:22:50 +03:00
|
|
|
'middleware' => Action\AuthenticateAction::class,
|
2017-07-15 10:00:53 +03:00
|
|
|
'allowed_methods' => [RequestMethod::METHOD_POST],
|
2016-07-19 18:07:59 +03:00
|
|
|
],
|
2017-07-07 14:12:45 +03:00
|
|
|
|
|
|
|
// Short codes
|
2016-07-19 18:07:59 +03:00
|
|
|
[
|
2017-07-07 14:12:45 +03:00
|
|
|
'name' => Action\CreateShortcodeAction::class,
|
2016-10-22 19:46:53 +03:00
|
|
|
'path' => '/rest/v{version:1}/short-codes',
|
2016-07-27 21:22:50 +03:00
|
|
|
'middleware' => Action\CreateShortcodeAction::class,
|
2017-07-15 10:00:53 +03:00
|
|
|
'allowed_methods' => [RequestMethod::METHOD_POST],
|
2016-07-19 18:07:59 +03:00
|
|
|
],
|
|
|
|
[
|
2017-07-07 14:12:45 +03:00
|
|
|
'name' => Action\ResolveUrlAction::class,
|
2016-10-22 19:46:53 +03:00
|
|
|
'path' => '/rest/v{version:1}/short-codes/{shortCode}',
|
2016-07-27 21:22:50 +03:00
|
|
|
'middleware' => Action\ResolveUrlAction::class,
|
2017-07-15 10:00:53 +03:00
|
|
|
'allowed_methods' => [RequestMethod::METHOD_GET],
|
2016-07-19 18:07:59 +03:00
|
|
|
],
|
|
|
|
[
|
2017-07-07 14:12:45 +03:00
|
|
|
'name' => Action\ListShortcodesAction::class,
|
2016-10-22 19:46:53 +03:00
|
|
|
'path' => '/rest/v{version:1}/short-codes',
|
2016-07-27 21:22:50 +03:00
|
|
|
'middleware' => Action\ListShortcodesAction::class,
|
2017-07-15 10:00:53 +03:00
|
|
|
'allowed_methods' => [RequestMethod::METHOD_GET],
|
2016-07-19 18:07:59 +03:00
|
|
|
],
|
|
|
|
[
|
2017-07-07 14:12:45 +03:00
|
|
|
'name' => Action\EditShortcodeTagsAction::class,
|
|
|
|
'path' => '/rest/v{version:1}/short-codes/{shortCode}/tags',
|
|
|
|
'middleware' => Action\EditShortcodeTagsAction::class,
|
2017-07-15 10:00:53 +03:00
|
|
|
'allowed_methods' => [RequestMethod::METHOD_PUT],
|
2017-07-07 14:12:45 +03:00
|
|
|
],
|
|
|
|
|
|
|
|
// Visits
|
|
|
|
[
|
|
|
|
'name' => Action\GetVisitsAction::class,
|
2016-10-22 19:46:53 +03:00
|
|
|
'path' => '/rest/v{version:1}/short-codes/{shortCode}/visits',
|
2016-07-27 21:22:50 +03:00
|
|
|
'middleware' => Action\GetVisitsAction::class,
|
2017-07-15 10:00:53 +03:00
|
|
|
'allowed_methods' => [RequestMethod::METHOD_GET],
|
2016-07-19 18:07:59 +03:00
|
|
|
],
|
2017-07-07 14:12:45 +03:00
|
|
|
|
|
|
|
// Tags
|
2016-08-21 17:52:26 +03:00
|
|
|
[
|
2017-07-15 10:00:53 +03:00
|
|
|
'name' => Action\Tag\ListTagsAction::class,
|
2017-07-07 14:12:45 +03:00
|
|
|
'path' => '/rest/v{version:1}/tags',
|
2017-07-15 10:00:53 +03:00
|
|
|
'middleware' => Action\Tag\ListTagsAction::class,
|
|
|
|
'allowed_methods' => [RequestMethod::METHOD_GET],
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'name' => Action\Tag\DeleteTagsAction::class,
|
|
|
|
'path' => '/rest/v{version:1}/tags',
|
|
|
|
'middleware' => Action\Tag\DeleteTagsAction::class,
|
|
|
|
'allowed_methods' => [RequestMethod::METHOD_DELETE],
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'name' => Action\Tag\CreateTagsAction::class,
|
|
|
|
'path' => '/rest/v{version:1}/tags',
|
|
|
|
'middleware' => Action\Tag\CreateTagsAction::class,
|
|
|
|
'allowed_methods' => [RequestMethod::METHOD_POST],
|
2016-08-21 17:52:26 +03:00
|
|
|
],
|
2017-07-15 13:04:12 +03:00
|
|
|
[
|
|
|
|
'name' => Action\Tag\UpdateTagAction::class,
|
|
|
|
'path' => '/rest/v{version:1}/tags',
|
|
|
|
'middleware' => Action\Tag\UpdateTagAction::class,
|
|
|
|
'allowed_methods' => [RequestMethod::METHOD_PUT],
|
|
|
|
],
|
2016-07-19 18:07:59 +03:00
|
|
|
],
|
|
|
|
|
|
|
|
];
|