memories/appinfo/routes.php

103 lines
5.0 KiB
PHP
Raw Normal View History

2022-08-13 01:58:37 +00:00
<?php
2022-10-29 18:09:38 +00:00
function getWildcard($param)
{
2022-10-29 18:09:38 +00:00
return [
'requirements' => [$param => '.*'],
'defaults' => [$param => '']
2022-10-29 18:09:38 +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
['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'],
['name' => 'Page#explore', 'url' => '/explore', 'verb' => 'GET'],
['name' => 'Page#nxsetup', 'url' => '/nxsetup', 'verb' => 'GET'],
2022-10-29 18:45:24 +00:00
// Routes with params
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'),
w(['name' => 'Page#tags', 'url' => '/tags/{name}', 'verb' => 'GET'], 'name'),
2022-08-13 03:34:05 +00:00
// Public folder share
['name' => 'Public#showShare', 'url' => '/s/{token}', 'verb' => 'GET'],
[
'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'],
['name' => 'PublicAlbum#download', 'url' => '/a/{token}/download', 'verb' => 'GET'],
2022-10-29 00:25:39 +00:00
2022-10-29 18:05:05 +00:00
// API Routes
['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'],
['name' => 'Folders#sub', 'url' => '/api/folders/sub', 'verb' => 'GET'],
2022-10-26 22:12:46 +00:00
['name' => 'Clusters#list', 'url' => '/api/clusters/{backend}', 'verb' => 'GET'],
['name' => 'Clusters#preview', 'url' => '/api/clusters/{backend}/preview', 'verb' => 'GET'],
['name' => 'Clusters#download', 'url' => '/api/clusters/{backend}/download', 'verb' => 'POST'],
2022-12-03 07:10:40 +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'],
['name' => 'Map#init', 'url' => '/api/map/init', 'verb' => 'GET'],
2023-02-08 22:13:13 +00:00
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'],
['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'],
['name' => 'Image#decodable', 'url' => '/api/image/decodable/{id}', 'verb' => 'GET'],
['name' => 'Image#editImage', 'url' => '/api/image/edit/{id}', 'verb' => 'PUT'],
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
['name' => 'Download#request', 'url' => '/api/download', 'verb' => 'POST'],
['name' => 'Download#file', 'url' => '/api/download/{handle}', 'verb' => 'GET'],
['name' => 'Download#one', 'url' => '/api/stream/{fileid}', 'verb' => 'GET'],
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'],
// Config
['name' => 'Other#setUserConfig', 'url' => '/api/config/{key}', 'verb' => 'PUT'],
['name' => 'Other#getUserConfig', 'url' => '/api/config', 'verb' => 'GET'],
['name' => 'Other#describeApi', 'url' => '/api/describe', 'verb' => 'GET'],
// Admin
['name' => 'Admin#getSystemStatus', 'url' => '/api/system-status', 'verb' => 'GET'],
['name' => 'Admin#getSystemConfig', 'url' => '/api/system-config', 'verb' => 'GET'],
['name' => 'Admin#setSystemConfig', 'url' => '/api/system-config/{key}', 'verb' => 'PUT'],
['name' => 'Admin#placesSetup', 'url' => '/api/occ/places-setup', 'verb' => 'POST'],
2022-10-17 02:52:44 +00:00
// Service worker
['name' => 'Other#serviceWorker', 'url' => '/service-worker.js', 'verb' => 'GET'],
2022-08-13 01:58:37 +00:00
]
];