Endpoints
in package
Registry of API V1 endpoints.
Extracted from api_v1.php lines 999-1070.
Table of Contents
Constants
- ROUTES = [ // Auth endpoints 'auth' => ['GET', 'POST'], 'auth/login' => ['POST'], 'auth/register' => ['POST'], 'auth/refresh' => ['POST'], 'auth/logout' => ['POST'], 'auth/me' => ['GET'], 'languages' => ['GET', 'POST', 'DELETE'], 'languages/definitions' => ['GET'], 'languages/with-texts' => ['GET'], 'languages/with-archived-texts' => ['GET'], 'media-files' => ['GET'], 'phonetic-reading' => ['GET'], 'review/next-word' => ['GET'], 'review/tomorrow-count' => ['GET'], 'review/status' => ['PUT'], 'review/config' => ['GET'], 'review/table-words' => ['GET'], 'sentences-with-term' => ['GET'], 'similar-terms' => ['GET'], 'settings' => ['POST'], 'settings/theme-path' => ['GET'], 'statuses' => ['GET'], 'tags' => ['GET'], 'tags/term' => ['GET'], 'tags/text' => ['GET'], 'terms' => ['GET', 'POST', 'PUT', 'DELETE'], 'terms/imported' => ['GET'], 'terms/new' => ['POST'], 'terms/quick' => ['POST'], 'terms/full' => ['POST'], 'terms/for-edit' => ['GET'], 'terms/bulk-status' => ['PUT'], 'terms/list' => ['GET'], 'terms/filter-options' => ['GET'], 'terms/bulk-action' => ['PUT'], 'terms/all-action' => ['PUT'], 'terms/family' => ['GET'], 'terms/family/status' => ['PUT'], 'terms/family/suggestion' => ['GET'], 'terms/family/apply' => ['PUT'], 'word-families' => ['GET'], 'word-families/stats' => ['GET'], 'texts' => ['GET', 'POST', 'PUT'], 'texts/statistics' => ['GET'], 'texts/scoring' => ['GET'], 'texts/scoring/recommended' => ['GET'], 'texts/by-language' => ['GET'], 'texts/archived-by-language' => ['GET'], 'feeds' => ['GET', 'POST', 'PUT', 'DELETE'], 'feeds/list' => ['GET'], 'feeds/articles' => ['GET'], 'feeds/articles/import' => ['POST'], 'books' => ['GET'], 'books/chapters' => ['GET'], 'books/progress' => ['PUT'], 'local-dictionaries' => ['GET', 'POST', 'PUT', 'DELETE'], 'local-dictionaries/lookup' => ['GET'], 'local-dictionaries/preview' => ['POST'], 'local-dictionaries/entries' => ['GET', 'POST', 'PUT', 'DELETE'], 'version' => ['GET'], // TTS endpoints (Piper TTS via NLP microservice) 'tts/voices' => ['GET', 'DELETE'], // GET for list, DELETE for tts/voices/{id} 'tts/voices/installed' => ['GET'], 'tts/voices/download' => ['POST'], 'tts/speak' => ['POST'], ]
Methods
- parseFragments() : array<int, string>
- Parse endpoint into fragments.
- resolve() : string|JsonResponse
- Check if an API endpoint exists and return it.
- getMethodsForEndpoint() : array<string|int, string>|null
- Get allowed methods for an endpoint.
Constants
ROUTES
private
array<string, array<string|int, string>>
ROUTES
= [
// Auth endpoints
'auth' => ['GET', 'POST'],
'auth/login' => ['POST'],
'auth/register' => ['POST'],
'auth/refresh' => ['POST'],
'auth/logout' => ['POST'],
'auth/me' => ['GET'],
'languages' => ['GET', 'POST', 'DELETE'],
'languages/definitions' => ['GET'],
'languages/with-texts' => ['GET'],
'languages/with-archived-texts' => ['GET'],
'media-files' => ['GET'],
'phonetic-reading' => ['GET'],
'review/next-word' => ['GET'],
'review/tomorrow-count' => ['GET'],
'review/status' => ['PUT'],
'review/config' => ['GET'],
'review/table-words' => ['GET'],
'sentences-with-term' => ['GET'],
'similar-terms' => ['GET'],
'settings' => ['POST'],
'settings/theme-path' => ['GET'],
'statuses' => ['GET'],
'tags' => ['GET'],
'tags/term' => ['GET'],
'tags/text' => ['GET'],
'terms' => ['GET', 'POST', 'PUT', 'DELETE'],
'terms/imported' => ['GET'],
'terms/new' => ['POST'],
'terms/quick' => ['POST'],
'terms/full' => ['POST'],
'terms/for-edit' => ['GET'],
'terms/bulk-status' => ['PUT'],
'terms/list' => ['GET'],
'terms/filter-options' => ['GET'],
'terms/bulk-action' => ['PUT'],
'terms/all-action' => ['PUT'],
'terms/family' => ['GET'],
'terms/family/status' => ['PUT'],
'terms/family/suggestion' => ['GET'],
'terms/family/apply' => ['PUT'],
'word-families' => ['GET'],
'word-families/stats' => ['GET'],
'texts' => ['GET', 'POST', 'PUT'],
'texts/statistics' => ['GET'],
'texts/scoring' => ['GET'],
'texts/scoring/recommended' => ['GET'],
'texts/by-language' => ['GET'],
'texts/archived-by-language' => ['GET'],
'feeds' => ['GET', 'POST', 'PUT', 'DELETE'],
'feeds/list' => ['GET'],
'feeds/articles' => ['GET'],
'feeds/articles/import' => ['POST'],
'books' => ['GET'],
'books/chapters' => ['GET'],
'books/progress' => ['PUT'],
'local-dictionaries' => ['GET', 'POST', 'PUT', 'DELETE'],
'local-dictionaries/lookup' => ['GET'],
'local-dictionaries/preview' => ['POST'],
'local-dictionaries/entries' => ['GET', 'POST', 'PUT', 'DELETE'],
'version' => ['GET'],
// TTS endpoints (Piper TTS via NLP microservice)
'tts/voices' => ['GET', 'DELETE'],
// GET for list, DELETE for tts/voices/{id}
'tts/voices/installed' => ['GET'],
'tts/voices/download' => ['POST'],
'tts/speak' => ['POST'],
]
Map of endpoint patterns to allowed HTTP methods
Methods
parseFragments()
Parse endpoint into fragments.
public
static parseFragments(string $endpoint) : array<int, string>
Parameters
- $endpoint : string
-
Endpoint path
Return values
array<int, string> —Endpoint path segments
resolve()
Check if an API endpoint exists and return it.
public
static resolve(string $method, string $requestUri) : string|JsonResponse
Parameters
- $method : string
-
HTTP method (e.g. 'GET' or 'POST')
- $requestUri : string
-
The URI being requested
Return values
string|JsonResponse —The matching endpoint path or error response
getMethodsForEndpoint()
Get allowed methods for an endpoint.
private
static getMethodsForEndpoint(string $endpoint) : array<string|int, string>|null
Parameters
- $endpoint : string
-
Endpoint path
Return values
array<string|int, string>|null —Allowed methods or null if not found