2022-08-13 01:58:37 +00:00
|
|
|
<?php
|
2022-10-29 18:09:38 +00:00
|
|
|
|
2023-01-18 03:02:00 +00:00
|
|
|
function getWildcard($param)
|
|
|
|
{
|
2022-10-29 18:09:38 +00:00
|
|
|
return [
|
2023-01-18 03:02:00 +00:00
|
|
|
'requirements' => [$param => '.*'],
|
|
|
|
'defaults' => [$param => '']
|
2022-10-29 18:09:38 +00:00
|
|
|
];
|
|
|
|
}
|
|
|
|
|
2023-01-18 03:02:00 +00:00
|
|
|
function w($base, $param)
|
|
|
|
{
|
2022-10-29 18:45:24 +00:00
|
|
|
return array_merge($base, getWildcard($param));
|
|
|
|
}
|
|
|
|
|
2022-08-13 01:58:37 +00:00
|
|
|
return [
|
|
|
|
'routes' => [
|
2022-10-29 18:09:38 +00:00
|
|
|
// Vue routes for deep links
|
2022-11-07 03:36:11 +00:00
|
|
|
['name' => 'Page#main', 'url' => '/', 'verb' => 'GET'],
|
|
|
|
['name' => 'Page#favorites', 'url' => '/favorites', 'verb' => 'GET'],
|
|
|
|
['name' => 'Page#videos', 'url' => '/videos', 'verb' => 'GET'],
|
|
|
|
['name' => 'Page#archive', 'url' => '/archive', 'verb' => 'GET'],
|
|
|
|
['name' => 'Page#thisday', 'url' => '/thisday', 'verb' => 'GET'],
|
2023-01-25 18:41:55 +00:00
|
|
|
['name' => 'Page#locations', 'url' => '/locations', 'verb' => 'GET'],
|
2022-10-29 18:45:24 +00:00
|
|
|
|
|
|
|
// Routes with params
|
2022-11-07 03:36:11 +00:00
|
|
|
w(['name' => 'Page#folder', 'url' => '/folders/{path}', 'verb' => 'GET'], 'path'),
|
|
|
|
w(['name' => 'Page#albums', 'url' => '/albums/{id}', 'verb' => 'GET'], 'id'),
|
2022-12-08 21:00:53 +00:00
|
|
|
w(['name' => 'Page#recognize', 'url' => '/recognize/{name}', 'verb' => 'GET'], 'name'),
|
|
|
|
w(['name' => 'Page#facerecognition', 'url' => '/facerecognition/{name}', 'verb' => 'GET'], 'name'),
|
2023-02-05 21:43:25 +00:00
|
|
|
w(['name' => 'Page#places', 'url' => '/places/{id}', 'verb' => 'GET'], 'id'),
|
2022-11-07 03:36:11 +00:00
|
|
|
w(['name' => 'Page#tags', 'url' => '/tags/{name}', 'verb' => 'GET'], 'name'),
|
2022-08-13 03:34:05 +00:00
|
|
|
|
2022-11-07 03:36:11 +00:00
|
|
|
// Public folder share
|
|
|
|
['name' => 'Public#showShare', 'url' => '/s/{token}', 'verb' => 'GET'],
|
|
|
|
[
|
2023-01-18 03:02:00 +00:00
|
|
|
'name' => 'Public#showAuthenticate',
|
|
|
|
'url' => '/s/{token}/authenticate/{redirect}',
|
|
|
|
'verb' => 'GET',
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'name' => 'Public#authenticate',
|
|
|
|
'url' => '/s/{token}/authenticate/{redirect}',
|
|
|
|
'verb' => 'POST',
|
|
|
|
],
|
|
|
|
|
|
|
|
// Public album share
|
|
|
|
['name' => 'PublicAlbum#showShare', 'url' => '/a/{token}', 'verb' => 'GET'],
|
2022-10-29 00:25:39 +00:00
|
|
|
|
2022-10-29 18:05:05 +00:00
|
|
|
// API Routes
|
2022-11-07 03:36:11 +00:00
|
|
|
['name' => 'Days#days', 'url' => '/api/days', 'verb' => 'GET'],
|
|
|
|
['name' => 'Days#day', 'url' => '/api/days/{id}', 'verb' => 'GET'],
|
|
|
|
['name' => 'Days#dayPost', 'url' => '/api/days', 'verb' => 'POST'],
|
2022-10-26 22:12:46 +00:00
|
|
|
|
2022-12-03 07:10:40 +00:00
|
|
|
['name' => 'Albums#albums', 'url' => '/api/albums', 'verb' => 'GET'],
|
2022-12-06 19:38:57 +00:00
|
|
|
['name' => 'Albums#download', 'url' => '/api/albums/download', 'verb' => 'POST'],
|
2022-12-03 07:10:40 +00:00
|
|
|
|
2022-11-07 03:36:11 +00:00
|
|
|
['name' => 'Tags#tags', 'url' => '/api/tags', 'verb' => 'GET'],
|
2022-12-05 02:37:14 +00:00
|
|
|
['name' => 'Tags#preview', 'url' => '/api/tags/preview/{tag}', 'verb' => 'GET'],
|
2022-10-26 22:12:46 +00:00
|
|
|
|
2022-12-08 21:00:53 +00:00
|
|
|
['name' => 'People#recognizePeople', 'url' => '/api/recognize/people', 'verb' => 'GET'],
|
|
|
|
['name' => 'People#recognizePeoplePreview', 'url' => '/api/recognize/people/preview/{id}', 'verb' => 'GET'],
|
|
|
|
['name' => 'People#facerecognitionPeople', 'url' => '/api/facerecognition/people', 'verb' => 'GET'],
|
|
|
|
['name' => 'People#facerecognitionPeoplePreview', 'url' => '/api/facerecognition/people/preview/{id}', 'verb' => 'GET'],
|
2022-10-26 22:12:46 +00:00
|
|
|
|
2023-02-05 21:43:25 +00:00
|
|
|
['name' => 'Places#places', 'url' => '/api/places', 'verb' => 'GET'],
|
|
|
|
['name' => 'Places#preview', 'url' => '/api/places/preview/{id}', 'verb' => 'GET'],
|
|
|
|
|
2022-12-03 07:10:40 +00:00
|
|
|
['name' => 'Archive#archive', 'url' => '/api/archive/{id}', 'verb' => 'PATCH'],
|
|
|
|
|
2022-12-03 05:04:31 +00:00
|
|
|
['name' => 'Image#preview', 'url' => '/api/image/preview/{id}', 'verb' => 'GET'],
|
2022-12-07 23:31:59 +00:00
|
|
|
['name' => 'Image#multipreview', 'url' => '/api/image/multipreview', 'verb' => 'POST'],
|
2022-11-10 05:39:13 +00:00
|
|
|
['name' => 'Image#info', 'url' => '/api/image/info/{id}', 'verb' => 'GET'],
|
2022-11-10 06:19:44 +00:00
|
|
|
['name' => 'Image#setExif', 'url' => '/api/image/set-exif/{id}', 'verb' => 'PATCH'],
|
2022-11-10 06:43:58 +00:00
|
|
|
['name' => 'Image#jpeg', 'url' => '/api/image/jpeg/{id}', 'verb' => 'GET'],
|
2022-10-29 18:05:05 +00:00
|
|
|
|
2022-11-11 05:25:26 +00:00
|
|
|
['name' => 'Video#transcode', 'url' => '/api/video/transcode/{client}/{fileid}/{profile}', 'verb' => 'GET'],
|
2022-11-22 13:04:15 +00:00
|
|
|
['name' => 'Video#livephoto', 'url' => '/api/video/livephoto/{fileid}', 'verb' => 'GET'],
|
2022-11-09 04:08:30 +00:00
|
|
|
|
2022-12-06 19:02:37 +00:00
|
|
|
['name' => 'Download#request', 'url' => '/api/download', 'verb' => 'POST'],
|
|
|
|
['name' => 'Download#file', 'url' => '/api/download/{handle}', 'verb' => 'GET'],
|
2023-01-18 03:55:17 +00:00
|
|
|
['name' => 'Download#one', 'url' => '/api/stream/{fileid}', 'verb' => 'GET'],
|
2022-12-06 19:02:37 +00:00
|
|
|
|
2023-02-08 03:59:04 +00:00
|
|
|
['name' => 'Location#clusters', 'url' => '/api/locations/clusters', 'verb' => 'GET'],
|
|
|
|
|
2022-08-20 00:18:04 +00:00
|
|
|
// Config API
|
2022-11-07 03:36:11 +00:00
|
|
|
['name' => 'Other#setUserConfig', 'url' => '/api/config/{key}', 'verb' => 'PUT'],
|
2022-10-17 02:52:44 +00:00
|
|
|
|
|
|
|
// Service worker
|
2022-11-07 03:36:11 +00:00
|
|
|
['name' => 'Other#serviceWorker', 'url' => '/service-worker.js', 'verb' => 'GET'],
|
2022-08-13 01:58:37 +00:00
|
|
|
]
|
|
|
|
];
|