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-02-08 22:13:13 +00:00
|
|
|
['name' => 'Page#map', 'url' => '/map', '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'],
|
2023-03-24 22:53:26 +00:00
|
|
|
['name' => 'Folders#sub', 'url' => '/api/folders/sub', 'verb' => 'GET'],
|
2022-10-26 22:12:46 +00:00
|
|
|
|
2023-03-23 18:08:36 +00:00
|
|
|
['name' => 'Clusters#list', 'url' => '/api/clusters/{backend}', 'verb' => 'GET'],
|
|
|
|
['name' => 'Clusters#preview', 'url' => '/api/clusters/{backend}/preview/{name}', 'verb' => 'GET'],
|
|
|
|
['name' => 'Clusters#download', 'url' => '/api/clusters/{backend}/download', 'verb' => 'POST'],
|
2022-12-03 07:10:40 +00:00
|
|
|
|
2023-03-08 04:14:42 +00:00
|
|
|
['name' => 'Tags#set', 'url' => '/api/tags/set/{id}', 'verb' => 'PATCH'],
|
2022-10-26 22:12:46 +00:00
|
|
|
|
2023-02-08 22:13:13 +00:00
|
|
|
['name' => 'Map#clusters', 'url' => '/api/map/clusters', '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'],
|
2023-03-15 19:28:33 +00:00
|
|
|
['name' => 'Image#decodable', 'url' => '/api/image/decodable/{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-03-10 20:15:13 +00:00
|
|
|
['name' => 'Share#links', 'url' => '/api/share/links', 'verb' => 'GET'],
|
|
|
|
['name' => 'Share#createNode', 'url' => '/api/share/node', 'verb' => 'POST'],
|
|
|
|
['name' => 'Share#deleteShare', 'url' => '/api/share/delete', 'verb' => 'POST'],
|
|
|
|
|
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
|
|
|
]
|
|
|
|
];
|