From 9b1cc947343253e6a55dd7159dbe05d3bfc8c4fb Mon Sep 17 00:00:00 2001 From: mattamon Date: Mon, 14 Oct 2024 09:27:54 +0200 Subject: [PATCH] Add configurable prefix --- config/pimcore/routing.yaml | 4 ++-- doc/10_Extending_Studio/01_Endpoints.md | 3 ++- src/Asset/Controller/CloneController.php | 2 +- .../Controller/Data/CustomMetadataController.php | 2 +- .../Controller/Data/CustomSettingsController.php | 2 +- src/Asset/Controller/Data/TextController.php | 2 +- .../Controller/Document/PreviewStreamController.php | 2 +- .../Controller/Download/CreateCsvController.php | 2 +- .../Controller/Download/CreateZipController.php | 2 +- .../Controller/Download/DeleteCsvController.php | 2 +- .../Controller/Download/DeleteZipController.php | 2 +- .../Controller/Download/DownloadCsvController.php | 2 +- .../Controller/Download/DownloadZipController.php | 2 +- src/Asset/Controller/DownloadController.php | 2 +- src/Asset/Controller/GetController.php | 2 +- .../Configuration/GetAvailableColumnsController.php | 2 +- .../Configuration/GetConfigurationController.php | 2 +- .../ListSavedConfigurationsController.php | 2 +- .../Configuration/SaveConfigurationController.php | 2 +- .../Grid/Configuration/SetAsFavoriteController.php | 2 +- .../Configuration/UpdateConfigurationController.php | 2 +- src/Asset/Controller/Grid/GetController.php | 2 +- .../Controller/Image/CustomDownloadController.php | 2 +- .../Controller/Image/FormatDownloadController.php | 2 +- .../Image/ThumbnailDownloadController.php | 2 +- src/Asset/Controller/PatchController.php | 2 +- src/Asset/Controller/TreeController.php | 2 +- src/Asset/Controller/UpdateController.php | 2 +- src/Asset/Controller/Upload/AddController.php | 2 +- src/Asset/Controller/Upload/InfoController.php | 2 +- src/Asset/Controller/Upload/ReplaceController.php | 2 +- src/Asset/Controller/Upload/ZipController.php | 2 +- .../Video/ImageThumbnailStreamController.php | 2 +- .../Video/ThumbnailDownloadController.php | 2 +- .../Controller/Video/ThumbnailStreamController.php | 2 +- src/Authorization/Controller/LoginController.php | 2 +- src/Authorization/Controller/LogoutController.php | 2 +- src/Controller/AbstractApiController.php | 13 +++++-------- src/DataObject/Controller/AddController.php | 2 +- src/DataObject/Controller/CloneController.php | 2 +- src/DataObject/Controller/GetController.php | 2 +- .../Grid/GetAvailableColumnsController.php | 2 +- src/DataObject/Controller/Grid/GetController.php | 2 +- src/DataObject/Controller/PatchController.php | 2 +- src/DataObject/Controller/ReplaceController.php | 2 +- src/DataObject/Controller/TreeController.php | 2 +- src/DataObject/Controller/UpdateController.php | 2 +- .../Controller/Element/CollectionController.php | 2 +- src/DependencyInjection/Configuration.php | 9 +++++++++ .../PimcoreStudioBackendExtension.php | 6 +++++- src/Element/Controller/DeleteController.php | 2 +- src/Element/Controller/DeleteInfoController.php | 2 +- src/Element/Controller/FolderController.php | 2 +- src/Element/Controller/GetIdByPathController.php | 2 +- src/Email/Controller/Blocklist/AddController.php | 2 +- .../Controller/Blocklist/CollectionController.php | 2 +- src/Email/Controller/Blocklist/DeleteController.php | 2 +- src/Email/Controller/CollectionController.php | 2 +- src/Email/Controller/DeleteController.php | 2 +- src/Email/Controller/Detail/EmailHtmlController.php | 2 +- .../Controller/Detail/EmailParamsController.php | 2 +- src/Email/Controller/Detail/EmailTextController.php | 2 +- src/Email/Controller/Detail/GetController.php | 2 +- src/Email/Controller/ForwardController.php | 2 +- src/Email/Controller/ResendController.php | 2 +- src/Email/Controller/TestEmailController.php | 2 +- src/ExecutionEngine/Controller/AbortController.php | 2 +- src/Mercure/Controller/JwtController.php | 2 +- src/Note/Controller/CollectionController.php | 2 +- src/Note/Controller/DeleteController.php | 2 +- .../Controller/Element/CollectionController.php | 2 +- src/Note/Controller/Element/CreateController.php | 2 +- src/Note/Controller/Element/TypeController.php | 2 +- .../Controller/CollectionController.php | 2 +- src/Notification/Controller/DeleteAllController.php | 2 +- src/Notification/Controller/DeleteController.php | 2 +- src/Notification/Controller/GetController.php | 2 +- src/Notification/Controller/ReadController.php | 2 +- src/Notification/Controller/SendController.php | 2 +- src/OpenApi/Service/OpenApiService.php | 12 ++++++++++++ src/Property/Controller/CollectionController.php | 2 +- src/Property/Controller/CreateController.php | 2 +- src/Property/Controller/DeleteController.php | 2 +- .../Controller/Element/CollectionController.php | 2 +- src/Property/Controller/UpdateController.php | 2 +- src/Role/Controller/CloneController.php | 2 +- src/Role/Controller/CreateFolderController.php | 2 +- src/Role/Controller/CreateRoleController.php | 2 +- src/Role/Controller/DeleteFolderController.php | 2 +- src/Role/Controller/DeleteRoleController.php | 2 +- src/Role/Controller/GetRoleController.php | 2 +- src/Role/Controller/GetRolesController.php | 2 +- src/Role/Controller/RoleTreeController.php | 2 +- src/Role/Controller/UpdateRoleController.php | 2 +- src/Schedule/Controller/DeleteController.php | 2 +- .../Controller/Element/CollectionController.php | 2 +- .../Controller/Element/CreateController.php | 2 +- .../Controller/Element/UpdateController.php | 2 +- src/Setting/Controller/GetController.php | 2 +- src/Tag/Controller/CollectionController.php | 2 +- src/Tag/Controller/CreateController.php | 2 +- src/Tag/Controller/DeleteController.php | 2 +- src/Tag/Controller/Element/AssignController.php | 2 +- .../Controller/Element/BatchAssignController.php | 2 +- .../Controller/Element/BatchReplaceController.php | 2 +- src/Tag/Controller/Element/CollectionController.php | 2 +- src/Tag/Controller/Element/UnassignController.php | 2 +- src/Tag/Controller/GetController.php | 2 +- src/Tag/Controller/UpdateController.php | 2 +- .../Controller/ImageCollectionController.php | 2 +- .../Controller/VideoCollectionController.php | 2 +- .../Controller/TranslationController.php | 2 +- src/User/Controller/CloneController.php | 2 +- src/User/Controller/CreateUserController.php | 2 +- src/User/Controller/CreateUserFolderController.php | 2 +- src/User/Controller/CurrentUserController.php | 2 +- src/User/Controller/DeleteUserController.php | 2 +- src/User/Controller/DeleteUserFolderController.php | 2 +- src/User/Controller/GetUserController.php | 2 +- .../Controller/GetUserPermissionsController.php | 2 +- src/User/Controller/GetUsersController.php | 2 +- src/User/Controller/ResetPasswordController.php | 2 +- src/User/Controller/UpdatePasswordController.php | 2 +- src/User/Controller/UpdateUserController.php | 2 +- src/User/Controller/UserTreeController.php | 2 +- src/Util/Trait/StudioBackendPathTrait.php | 2 +- src/Version/Controller/Asset/DownloadController.php | 2 +- .../Controller/Asset/ImageStreamController.php | 2 +- .../Controller/Asset/PdfStreamController.php | 2 +- src/Version/Controller/DeleteController.php | 2 +- .../Controller/Element/CleanupController.php | 2 +- .../Controller/Element/CollectionController.php | 2 +- src/Version/Controller/GetController.php | 2 +- src/Version/Controller/PublishController.php | 2 +- src/Version/Controller/UpdateController.php | 2 +- .../Controller/DetailsCollectionController.php | 2 +- src/Workflow/Controller/SubmitActionController.php | 2 +- 137 files changed, 166 insertions(+), 143 deletions(-) diff --git a/config/pimcore/routing.yaml b/config/pimcore/routing.yaml index d00029434..b0d8099d1 100644 --- a/config/pimcore/routing.yaml +++ b/config/pimcore/routing.yaml @@ -1,6 +1,6 @@ -studio_api: +pimcore_studio_api: resource: "../../src/" type: annotation - prefix: /studio/api + prefix: '%pimcore_studio_backend.url_prefix%' options: expose: true diff --git a/doc/10_Extending_Studio/01_Endpoints.md b/doc/10_Extending_Studio/01_Endpoints.md index ec0b9ddee..aea141b65 100644 --- a/doc/10_Extending_Studio/01_Endpoints.md +++ b/doc/10_Extending_Studio/01_Endpoints.md @@ -27,6 +27,7 @@ To add a custom endpoint to the Pimcore Studio Backend you need to implement it - We try to leverage symfony functionality as much as possible for parameters with `#[MapQueryString]` or `#[MapRequestPayload]` attributes ### Example + ```php value)] #[Get( - path: self::API_PATH . '/notes', + path: self::PREFIX . '/notes', operationId: 'note_get_collection', description: 'note_get_collection_description', summary: 'note_get_collection_summary', diff --git a/src/Asset/Controller/CloneController.php b/src/Asset/Controller/CloneController.php index b81041459..1cbb996c1 100644 --- a/src/Asset/Controller/CloneController.php +++ b/src/Asset/Controller/CloneController.php @@ -63,7 +63,7 @@ public function __construct( #[Route('/assets/{id}/clone/{parentId}', name: 'pimcore_studio_api_assets_clone', methods: ['POST'])] #[IsGranted(UserPermissions::ASSETS->value)] #[Post( - path: self::API_PATH . '/assets/{id}/clone/{parentId}', + path: self::PREFIX . '/assets/{id}/clone/{parentId}', operationId: 'asset_clone', description: 'asset_clone_description', summary: 'asset_clone_summary', diff --git a/src/Asset/Controller/Data/CustomMetadataController.php b/src/Asset/Controller/Data/CustomMetadataController.php index 2448cfd41..d9224908b 100644 --- a/src/Asset/Controller/Data/CustomMetadataController.php +++ b/src/Asset/Controller/Data/CustomMetadataController.php @@ -55,7 +55,7 @@ public function __construct( #[Route('/assets/{id}/custom-metadata', name: 'pimcore_studio_api_get_asset_custom_metadata', methods: ['GET'])] #[IsGranted(UserPermissions::ASSETS->value)] #[GET( - path: self::API_PATH . '/assets/{id}/custom-metadata', + path: self::PREFIX . '/assets/{id}/custom-metadata', operationId: 'asset_custom_metadata_get_by_id', description: 'asset_custom_metadata_get_by_id_description', summary: 'asset_custom_metadata_get_by_id_summary', diff --git a/src/Asset/Controller/Data/CustomSettingsController.php b/src/Asset/Controller/Data/CustomSettingsController.php index 8f09c0806..15b396d02 100644 --- a/src/Asset/Controller/Data/CustomSettingsController.php +++ b/src/Asset/Controller/Data/CustomSettingsController.php @@ -54,7 +54,7 @@ public function __construct( #[Route('/assets/{id}/custom-settings', name: 'pimcore_studio_api_get_asset_custom_settings', methods: ['GET'])] #[IsGranted(UserPermissions::ASSETS->value)] #[GET( - path: self::API_PATH . '/assets/{id}/custom-settings', + path: self::PREFIX . '/assets/{id}/custom-settings', operationId: 'asset_custom_settings_get_by_id', description: 'asset_custom_settings_get_by_id_description', summary: 'asset_custom_settings_get_by_id_summary', diff --git a/src/Asset/Controller/Data/TextController.php b/src/Asset/Controller/Data/TextController.php index daac1c43e..9d5278c8d 100644 --- a/src/Asset/Controller/Data/TextController.php +++ b/src/Asset/Controller/Data/TextController.php @@ -57,7 +57,7 @@ public function __construct( #[Route('/assets/{id}/text', name: 'pimcore_studio_api_get_asset_data_text', methods: ['GET'])] #[IsGranted(UserPermissions::ASSETS->value)] #[Get( - path: self::API_PATH . '/assets/{id}/text', + path: self::PREFIX . '/assets/{id}/text', operationId: 'asset_get_text_data_by_id', description: 'asset_get_text_data_by_id_description', summary: 'asset_get_text_data_by_id_summary', diff --git a/src/Asset/Controller/Document/PreviewStreamController.php b/src/Asset/Controller/Document/PreviewStreamController.php index a73857064..3c91ec50a 100644 --- a/src/Asset/Controller/Document/PreviewStreamController.php +++ b/src/Asset/Controller/Document/PreviewStreamController.php @@ -73,7 +73,7 @@ public function __construct( )] #[IsGranted(UserPermissions::ASSETS->value)] #[Get( - path: self::API_PATH . '/assets/{id}/document/stream/pdf-preview', + path: self::PREFIX . '/assets/{id}/document/stream/pdf-preview', operationId: 'asset_document_stream_preview', description: 'asset_document_stream_preview_description', summary: 'asset_document_stream_preview_summary', diff --git a/src/Asset/Controller/Download/CreateCsvController.php b/src/Asset/Controller/Download/CreateCsvController.php index 26d15a3a8..5cfd9c674 100644 --- a/src/Asset/Controller/Download/CreateCsvController.php +++ b/src/Asset/Controller/Download/CreateCsvController.php @@ -48,7 +48,7 @@ public function __construct( #[Route('/assets/csv/create', name: 'pimcore_studio_api_create_csv_asset', methods: ['POST'])] #[IsGranted(UserPermissions::ASSETS->value)] #[Post( - path: self::API_PATH . '/assets/csv/create', + path: self::PREFIX . '/assets/csv/create', operationId: 'asset_create_csv', description: 'asset_create_csv_description', summary: 'asset_create_csv_summary', diff --git a/src/Asset/Controller/Download/CreateZipController.php b/src/Asset/Controller/Download/CreateZipController.php index df53ce21f..2fb624e84 100644 --- a/src/Asset/Controller/Download/CreateZipController.php +++ b/src/Asset/Controller/Download/CreateZipController.php @@ -58,7 +58,7 @@ public function __construct( #[Route('/assets/zip/create', name: 'pimcore_studio_api_create_zip_asset', methods: ['POST'])] #[IsGranted(UserPermissions::ASSETS->value)] #[Post( - path: self::API_PATH . '/assets/zip/create', + path: self::PREFIX . '/assets/zip/create', operationId: 'asset_create_zip', description: 'asset_create_zip_description', summary: 'asset_create_zip_summary', diff --git a/src/Asset/Controller/Download/DeleteCsvController.php b/src/Asset/Controller/Download/DeleteCsvController.php index d7c437415..36712936b 100644 --- a/src/Asset/Controller/Download/DeleteCsvController.php +++ b/src/Asset/Controller/Download/DeleteCsvController.php @@ -52,7 +52,7 @@ public function __construct( #[Route('/assets/download/csv/{jobRunId}', name: 'pimcore_studio_api_csv_delete', methods: ['DELETE'])] #[IsGranted(UserPermissions::ASSETS->value)] #[Delete( - path: self::API_PATH . '/assets/download/csv/{jobRunId}', + path: self::PREFIX . '/assets/download/csv/{jobRunId}', operationId: 'asset_delete_csv', description: 'asset_delete_csv_description', summary: 'asset_delete_csv_summary', diff --git a/src/Asset/Controller/Download/DeleteZipController.php b/src/Asset/Controller/Download/DeleteZipController.php index b5edc70ee..7c7282091 100644 --- a/src/Asset/Controller/Download/DeleteZipController.php +++ b/src/Asset/Controller/Download/DeleteZipController.php @@ -51,7 +51,7 @@ public function __construct( #[Route('/assets/download/zip/{jobRunId}', name: 'pimcore_studio_api_zip_delete', methods: ['DELETE'])] #[IsGranted(UserPermissions::ASSETS->value)] #[Delete( - path: self::API_PATH . '/assets/download/zip/{jobRunId}', + path: self::PREFIX . '/assets/download/zip/{jobRunId}', operationId: 'asset_delete_zip', description: 'asset_delete_zip_description', summary: 'asset_delete_zip_summary', diff --git a/src/Asset/Controller/Download/DownloadCsvController.php b/src/Asset/Controller/Download/DownloadCsvController.php index 2eb0d433b..43a3b01ad 100644 --- a/src/Asset/Controller/Download/DownloadCsvController.php +++ b/src/Asset/Controller/Download/DownloadCsvController.php @@ -56,7 +56,7 @@ public function __construct( #[Route('/assets/download/csv/{jobRunId}', name: 'pimcore_studio_api_csv_download_asset', methods: ['GET'])] #[IsGranted(UserPermissions::ASSETS->value)] #[Get( - path: self::API_PATH . '/assets/download/csv/{jobRunId}', + path: self::PREFIX . '/assets/download/csv/{jobRunId}', operationId: 'asset_download_csv', description: 'asset_download_csv_description', summary: 'asset_download_csv_summary', diff --git a/src/Asset/Controller/Download/DownloadZipController.php b/src/Asset/Controller/Download/DownloadZipController.php index 93f24d5d0..f2cccb8b4 100644 --- a/src/Asset/Controller/Download/DownloadZipController.php +++ b/src/Asset/Controller/Download/DownloadZipController.php @@ -56,7 +56,7 @@ public function __construct( #[Route('/assets/download/zip/{jobRunId}', name: 'pimcore_studio_api_zip_download_asset', methods: ['GET'])] #[IsGranted(UserPermissions::ASSETS->value)] #[Get( - path: self::API_PATH . '/assets/download/zip/{jobRunId}', + path: self::PREFIX . '/assets/download/zip/{jobRunId}', operationId: 'asset_download_zip', description: 'asset_download_zip_description', summary: 'asset_download_zip_summary', diff --git a/src/Asset/Controller/DownloadController.php b/src/Asset/Controller/DownloadController.php index 65ad912fc..0c340010e 100644 --- a/src/Asset/Controller/DownloadController.php +++ b/src/Asset/Controller/DownloadController.php @@ -64,7 +64,7 @@ public function __construct( #[Route('/assets/{id}/download', name: 'pimcore_studio_api_download_asset', methods: ['GET'])] #[IsGranted(UserPermissions::ASSETS->value)] #[Get( - path: self::API_PATH . '/assets/{id}/download', + path: self::PREFIX . '/assets/{id}/download', operationId: 'asset_download_by_id', description: 'asset_download_by_id_description', summary: 'asset_download_by_id_summary', diff --git a/src/Asset/Controller/GetController.php b/src/Asset/Controller/GetController.php index 9ec855b8c..e1601d5b6 100644 --- a/src/Asset/Controller/GetController.php +++ b/src/Asset/Controller/GetController.php @@ -52,7 +52,7 @@ public function __construct( #[Route('/assets/{id}', name: 'pimcore_studio_api_get_asset', requirements: ['id' => '\d+'], methods: ['GET'])] #[IsGranted(UserPermissions::ASSETS->value)] #[Get( - path: self::API_PATH . '/assets/{id}', + path: self::PREFIX . '/assets/{id}', operationId: 'asset_get_by_id', description: 'asset_get_by_id_description', summary: 'asset_get_by_id_summary', diff --git a/src/Asset/Controller/Grid/Configuration/GetAvailableColumnsController.php b/src/Asset/Controller/Grid/Configuration/GetAvailableColumnsController.php index 5fc65b6ac..41ed67479 100644 --- a/src/Asset/Controller/Grid/Configuration/GetAvailableColumnsController.php +++ b/src/Asset/Controller/Grid/Configuration/GetAvailableColumnsController.php @@ -57,7 +57,7 @@ public function __construct( )] #[IsGranted(UserPermissions::ASSETS->value)] #[Get( - path: self::API_PATH . '/assets/grid/available-columns', + path: self::PREFIX . '/assets/grid/available-columns', operationId: 'asset_get_available_grid_columns', description: 'asset_get_available_grid_columns_description', summary: 'asset_get_available_grid_columns_summary', diff --git a/src/Asset/Controller/Grid/Configuration/GetConfigurationController.php b/src/Asset/Controller/Grid/Configuration/GetConfigurationController.php index 2388fab66..39df175c2 100644 --- a/src/Asset/Controller/Grid/Configuration/GetConfigurationController.php +++ b/src/Asset/Controller/Grid/Configuration/GetConfigurationController.php @@ -59,7 +59,7 @@ public function __construct( )] #[IsGranted(UserPermissions::ASSETS->value)] #[Get( - path: self::API_PATH . '/assets/grid/configuration/{folderId}', + path: self::PREFIX . '/assets/grid/configuration/{folderId}', operationId: 'asset_get_grid_configuration_by_folderId', description: 'asset_get_grid_configuration_by_folderId_description', summary: 'asset_get_grid_configuration_by_folderId_summary', diff --git a/src/Asset/Controller/Grid/Configuration/ListSavedConfigurationsController.php b/src/Asset/Controller/Grid/Configuration/ListSavedConfigurationsController.php index fdaa5ca9a..33abb8455 100644 --- a/src/Asset/Controller/Grid/Configuration/ListSavedConfigurationsController.php +++ b/src/Asset/Controller/Grid/Configuration/ListSavedConfigurationsController.php @@ -57,7 +57,7 @@ public function __construct( )] #[IsGranted(UserPermissions::ASSETS->value)] #[Get( - path: self::API_PATH . '/assets/grid/configurations/{folderId}', + path: self::PREFIX . '/assets/grid/configurations/{folderId}', operationId: 'asset_get_saved_grid_configurations', description: 'asset_get_saved_grid_configurations_description', summary: 'asset_get_saved_grid_configurations_summary', diff --git a/src/Asset/Controller/Grid/Configuration/SaveConfigurationController.php b/src/Asset/Controller/Grid/Configuration/SaveConfigurationController.php index 2d0d58c1d..d2f747f9e 100644 --- a/src/Asset/Controller/Grid/Configuration/SaveConfigurationController.php +++ b/src/Asset/Controller/Grid/Configuration/SaveConfigurationController.php @@ -55,7 +55,7 @@ public function __construct( )] #[IsGranted(UserPermissions::ASSETS->value)] #[Post( - path: self::API_PATH . '/assets/grid/configuration/save', + path: self::PREFIX . '/assets/grid/configuration/save', operationId: 'asset_save_grid_configuration', description: 'asset_save_grid_configuration_description', summary: 'asset_save_grid_configuration_description', diff --git a/src/Asset/Controller/Grid/Configuration/SetAsFavoriteController.php b/src/Asset/Controller/Grid/Configuration/SetAsFavoriteController.php index 2ff3eb604..f834d3a92 100644 --- a/src/Asset/Controller/Grid/Configuration/SetAsFavoriteController.php +++ b/src/Asset/Controller/Grid/Configuration/SetAsFavoriteController.php @@ -55,7 +55,7 @@ public function __construct( )] #[IsGranted(UserPermissions::ASSETS->value)] #[Post( - path: self::API_PATH . '/assets/grid/configuration/set-as-favorite/{configurationId}/{folderId}', + path: self::PREFIX . '/assets/grid/configuration/set-as-favorite/{configurationId}/{folderId}', operationId: 'asset_set_grid_configuration_as_favorite', description: 'asset_set_grid_configuration_as_favorite_description', summary: 'asset_set_grid_configuration_as_favorite_summary', diff --git a/src/Asset/Controller/Grid/Configuration/UpdateConfigurationController.php b/src/Asset/Controller/Grid/Configuration/UpdateConfigurationController.php index 7723b470c..31d3f3f79 100644 --- a/src/Asset/Controller/Grid/Configuration/UpdateConfigurationController.php +++ b/src/Asset/Controller/Grid/Configuration/UpdateConfigurationController.php @@ -56,7 +56,7 @@ public function __construct( )] #[IsGranted(UserPermissions::ASSETS->value)] #[Put( - path: self::API_PATH . '/assets/grid/configuration/update/{configurationId}', + path: self::PREFIX . '/assets/grid/configuration/update/{configurationId}', operationId: 'asset_update_grid_configuration', description: 'asset_update_grid_configuration_description', summary: 'asset_update_grid_configuration_summary', diff --git a/src/Asset/Controller/Grid/GetController.php b/src/Asset/Controller/Grid/GetController.php index 4d174c89a..639873f12 100644 --- a/src/Asset/Controller/Grid/GetController.php +++ b/src/Asset/Controller/Grid/GetController.php @@ -53,7 +53,7 @@ public function __construct( #[Route('/assets/grid', name: 'pimcore_studio_api_get_asset_grid', methods: ['POST'])] #[IsGranted(UserPermissions::ASSETS->value)] #[Post( - path: self::API_PATH . '/assets/grid', + path: self::PREFIX . '/assets/grid', operationId: 'asset_get_grid', description: 'asset_get_grid_description', summary: 'asset_get_grid_summary', diff --git a/src/Asset/Controller/Image/CustomDownloadController.php b/src/Asset/Controller/Image/CustomDownloadController.php index 3975e0cf9..81e71ab5a 100644 --- a/src/Asset/Controller/Image/CustomDownloadController.php +++ b/src/Asset/Controller/Image/CustomDownloadController.php @@ -72,7 +72,7 @@ public function __construct( )] #[IsGranted(UserPermissions::ASSETS->value)] #[Get( - path: self::API_PATH . '/assets/{id}/image/download/custom', + path: self::PREFIX . '/assets/{id}/image/download/custom', operationId: 'asset_image_download_custom', description: 'asset_image_download_custom_description', summary: 'asset_image_download_custom_summary', diff --git a/src/Asset/Controller/Image/FormatDownloadController.php b/src/Asset/Controller/Image/FormatDownloadController.php index e0e3cc210..892a24177 100644 --- a/src/Asset/Controller/Image/FormatDownloadController.php +++ b/src/Asset/Controller/Image/FormatDownloadController.php @@ -72,7 +72,7 @@ public function __construct( )] #[IsGranted(UserPermissions::ASSETS->value)] #[Get( - path: self::API_PATH . '/assets/{id}/image/download/format/{format}', + path: self::PREFIX . '/assets/{id}/image/download/format/{format}', operationId: 'asset_image_download_by_format', description: 'asset_image_download_by_format_description', summary: 'asset_image_download_by_format_summary', diff --git a/src/Asset/Controller/Image/ThumbnailDownloadController.php b/src/Asset/Controller/Image/ThumbnailDownloadController.php index 49a085ed2..33fec52ad 100644 --- a/src/Asset/Controller/Image/ThumbnailDownloadController.php +++ b/src/Asset/Controller/Image/ThumbnailDownloadController.php @@ -68,7 +68,7 @@ public function __construct( )] #[IsGranted(UserPermissions::ASSETS->value)] #[Get( - path: self::API_PATH . '/assets/{id}/image/download/thumbnail/{thumbnailName}', + path: self::PREFIX . '/assets/{id}/image/download/thumbnail/{thumbnailName}', operationId: 'asset_image_download_by_thumbnail', description: 'asset_image_download_by_thumbnail_description', summary: 'asset_image_download_by_thumbnail_summary', diff --git a/src/Asset/Controller/PatchController.php b/src/Asset/Controller/PatchController.php index 78ec46ea1..21a33734e 100644 --- a/src/Asset/Controller/PatchController.php +++ b/src/Asset/Controller/PatchController.php @@ -61,7 +61,7 @@ public function __construct( #[Route('/assets', name: 'pimcore_studio_api_patch_asset', methods: ['PATCH'])] #[IsGranted(UserPermissions::ASSETS->value)] #[Patch( - path: self::API_PATH . '/assets', + path: self::PREFIX . '/assets', operationId: 'asset_patch_by_id', description: 'asset_patch_by_id_description', summary: 'asset_patch_by_id_summary', diff --git a/src/Asset/Controller/TreeController.php b/src/Asset/Controller/TreeController.php index c5b5a3d30..a0fb47281 100644 --- a/src/Asset/Controller/TreeController.php +++ b/src/Asset/Controller/TreeController.php @@ -66,7 +66,7 @@ public function __construct( #[Route('/assets/tree', name: 'pimcore_studio_api_assets_tree', methods: ['GET'])] #[IsGranted(UserPermissions::ASSETS->value)] #[Get( - path: self::API_PATH . '/assets/tree', + path: self::PREFIX . '/assets/tree', operationId: 'asset_get_tree', description: 'asset_get_tree_description', summary: 'asset_get_tree_summary', diff --git a/src/Asset/Controller/UpdateController.php b/src/Asset/Controller/UpdateController.php index c5b93b7be..7292292a7 100644 --- a/src/Asset/Controller/UpdateController.php +++ b/src/Asset/Controller/UpdateController.php @@ -52,7 +52,7 @@ public function __construct( #[Route('/assets/{id}', name: 'pimcore_studio_api_update_asset', methods: ['PUT'])] #[IsGranted(UserPermissions::ASSETS->value)] #[Put( - path: self::API_PATH . '/assets/{id}', + path: self::PREFIX . '/assets/{id}', operationId: 'asset_update_by_id', description: 'asset_update_by_id_description', summary: 'asset_update_by_id_summary', diff --git a/src/Asset/Controller/Upload/AddController.php b/src/Asset/Controller/Upload/AddController.php index 92257dab0..3a908348c 100644 --- a/src/Asset/Controller/Upload/AddController.php +++ b/src/Asset/Controller/Upload/AddController.php @@ -69,7 +69,7 @@ public function __construct( #[Route('/assets/add/{parentId}', name: 'pimcore_studio_api_assets_add', methods: ['POST'])] #[IsGranted(UserPermissions::ASSETS->value)] #[Post( - path: self::API_PATH . '/assets/add/{parentId}', + path: self::PREFIX . '/assets/add/{parentId}', operationId: 'asset_add', description: 'asset_add_description', summary: 'asset_add_summary', diff --git a/src/Asset/Controller/Upload/InfoController.php b/src/Asset/Controller/Upload/InfoController.php index ced3d0637..4da632c36 100644 --- a/src/Asset/Controller/Upload/InfoController.php +++ b/src/Asset/Controller/Upload/InfoController.php @@ -59,7 +59,7 @@ public function __construct( #[Route('/assets/exists/{parentId}', name: 'pimcore_studio_api_asset_upload_info', methods: ['GET'])] #[IsGranted(UserPermissions::ASSETS->value)] #[Get( - path: self::API_PATH . '/assets/exists/{parentId}', + path: self::PREFIX . '/assets/exists/{parentId}', operationId: 'asset_upload_info', description: 'asset_upload_info_description', summary: 'asset_upload_info_summary', diff --git a/src/Asset/Controller/Upload/ReplaceController.php b/src/Asset/Controller/Upload/ReplaceController.php index dce160c0d..aae41c7d6 100644 --- a/src/Asset/Controller/Upload/ReplaceController.php +++ b/src/Asset/Controller/Upload/ReplaceController.php @@ -67,7 +67,7 @@ public function __construct( #[Route('/assets/{id}/replace', name: 'pimcore_studio_api_assets_replace', methods: ['POST'])] #[IsGranted(UserPermissions::ASSETS->value)] #[Post( - path: self::API_PATH . '/assets/{id}/replace', + path: self::PREFIX . '/assets/{id}/replace', operationId: 'asset_replace', description: 'asset_replace_description', summary: 'asset_replace_summary', diff --git a/src/Asset/Controller/Upload/ZipController.php b/src/Asset/Controller/Upload/ZipController.php index 1e6c7f4ff..687b3aff5 100644 --- a/src/Asset/Controller/Upload/ZipController.php +++ b/src/Asset/Controller/Upload/ZipController.php @@ -67,7 +67,7 @@ public function __construct( #[Route('/assets/add-zip/{parentId}', name: 'pimcore_studio_api_assets_upload_zip', methods: ['POST'])] #[IsGranted(UserPermissions::ASSETS->value)] #[Post( - path: self::API_PATH . '/assets/add-zip/{parentId}', + path: self::PREFIX . '/assets/add-zip/{parentId}', operationId: 'asset_upload_zip', description: 'asset_upload_zip_description', summary: 'asset_upload_zip_summary', diff --git a/src/Asset/Controller/Video/ImageThumbnailStreamController.php b/src/Asset/Controller/Video/ImageThumbnailStreamController.php index 16f6e4b23..d66b52137 100644 --- a/src/Asset/Controller/Video/ImageThumbnailStreamController.php +++ b/src/Asset/Controller/Video/ImageThumbnailStreamController.php @@ -77,7 +77,7 @@ public function __construct( )] #[IsGranted(UserPermissions::ASSETS->value)] #[Get( - path: self::API_PATH . '/assets/{id}/video/stream/image-thumbnail', + path: self::PREFIX . '/assets/{id}/video/stream/image-thumbnail', operationId: 'asset_video_image_thumbnail_stream', description: 'asset_video_image_thumbnail_stream_description', summary: 'asset_video_image_thumbnail_stream_summary', diff --git a/src/Asset/Controller/Video/ThumbnailDownloadController.php b/src/Asset/Controller/Video/ThumbnailDownloadController.php index 8dfc2e962..d1c83b607 100644 --- a/src/Asset/Controller/Video/ThumbnailDownloadController.php +++ b/src/Asset/Controller/Video/ThumbnailDownloadController.php @@ -72,7 +72,7 @@ public function __construct( )] #[IsGranted(UserPermissions::ASSETS->value)] #[Get( - path: self::API_PATH . '/assets/{id}/video/download/{thumbnailName}', + path: self::PREFIX . '/assets/{id}/video/download/{thumbnailName}', operationId: 'asset_video_download_by_thumbnail', description: 'asset_video_download_by_thumbnail_description', summary: 'asset_video_download_by_thumbnail_summary', diff --git a/src/Asset/Controller/Video/ThumbnailStreamController.php b/src/Asset/Controller/Video/ThumbnailStreamController.php index cc3ad9619..7174be7ff 100644 --- a/src/Asset/Controller/Video/ThumbnailStreamController.php +++ b/src/Asset/Controller/Video/ThumbnailStreamController.php @@ -72,7 +72,7 @@ public function __construct( )] #[IsGranted(UserPermissions::ASSETS->value)] #[Get( - path: self::API_PATH . '/assets/{id}/video/stream/{thumbnailName}', + path: self::PREFIX . '/assets/{id}/video/stream/{thumbnailName}', operationId: 'asset_video_stream_by_thumbnail', description: 'asset_video_stream_by_thumbnail_description', summary: 'asset_video_stream_by_thumbnail_summary', diff --git a/src/Authorization/Controller/LoginController.php b/src/Authorization/Controller/LoginController.php index f8a7c2720..371cf564c 100644 --- a/src/Authorization/Controller/LoginController.php +++ b/src/Authorization/Controller/LoginController.php @@ -37,7 +37,7 @@ final class LoginController extends AbstractApiController { #[Route('/login', name: 'pimcore_studio_api_login', methods: ['POST'])] #[Post( - path: self::API_PATH . '/login', + path: self::PREFIX . '/login', operationId: 'login', description: 'login_description', summary: 'login_summary', diff --git a/src/Authorization/Controller/LogoutController.php b/src/Authorization/Controller/LogoutController.php index f4438f028..defd6353b 100644 --- a/src/Authorization/Controller/LogoutController.php +++ b/src/Authorization/Controller/LogoutController.php @@ -30,7 +30,7 @@ final class LogoutController extends AbstractApiController { #[Route('/logout', name: 'pimcore_studio_api_logout', methods: ['POST'])] #[Post( - path: self::API_PATH . '/logout', + path: self::PREFIX . '/logout', operationId: 'logout', description: 'logout_description', summary: 'logout_summary', diff --git a/src/Controller/AbstractApiController.php b/src/Controller/AbstractApiController.php index 5f8053eb0..4e2d61ac3 100644 --- a/src/Controller/AbstractApiController.php +++ b/src/Controller/AbstractApiController.php @@ -20,22 +20,19 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Serializer\SerializerInterface; -/** - * @internal - */ -#[Route('/studio/api')] + abstract class AbstractApiController extends AbstractController { public const VOTER_PUBLIC_STUDIO_API = 'PUBLIC_STUDIO_API'; - public const API_PATH = '/studio/api'; + public const PREFIX = '{prefix}'; - public function __construct(protected readonly SerializerInterface $serializer) + public function __construct( + protected readonly SerializerInterface $serializer, + ) { - } protected function jsonResponse( diff --git a/src/DataObject/Controller/AddController.php b/src/DataObject/Controller/AddController.php index af7b10094..eeb62ca4b 100644 --- a/src/DataObject/Controller/AddController.php +++ b/src/DataObject/Controller/AddController.php @@ -64,7 +64,7 @@ public function __construct( #[Route('/data-objects/add/{parentId}', name: 'pimcore_studio_api_data_objects_add', methods: ['POST'])] #[IsGranted(UserPermissions::DATA_OBJECTS->value)] #[Post( - path: self::API_PATH . '/data-objects/add/{parentId}', + path: self::PREFIX . '/data-objects/add/{parentId}', operationId: 'data_object_add', description: 'data_object_add_description', summary: 'data_object_add_summary', diff --git a/src/DataObject/Controller/CloneController.php b/src/DataObject/Controller/CloneController.php index 5ffd8ee9d..4bb6d62e0 100644 --- a/src/DataObject/Controller/CloneController.php +++ b/src/DataObject/Controller/CloneController.php @@ -63,7 +63,7 @@ public function __construct( #[Route('/data-objects/{id}/clone/{parentId}', name: 'pimcore_studio_api_data_objects_clone', methods: ['POST'])] #[IsGranted(UserPermissions::DATA_OBJECTS->value)] #[Post( - path: self::API_PATH . '/data-objects/{id}/clone/{parentId}', + path: self::PREFIX . '/data-objects/{id}/clone/{parentId}', operationId: 'data_object_clone', description: 'data_object_clone_description', summary: 'data_object_clone_summary', diff --git a/src/DataObject/Controller/GetController.php b/src/DataObject/Controller/GetController.php index 5e0104000..33f0ec341 100644 --- a/src/DataObject/Controller/GetController.php +++ b/src/DataObject/Controller/GetController.php @@ -51,7 +51,7 @@ public function __construct( )] #[IsGranted(UserPermissions::DATA_OBJECTS->value)] #[Get( - path: self::API_PATH . '/data-objects/{id}', + path: self::PREFIX . '/data-objects/{id}', operationId: 'data_object_get_by_id', description: 'data_object_get_by_id_description', summary: 'data_object_get_by_id_summary', diff --git a/src/DataObject/Controller/Grid/GetAvailableColumnsController.php b/src/DataObject/Controller/Grid/GetAvailableColumnsController.php index a9677834e..2855d17f8 100644 --- a/src/DataObject/Controller/Grid/GetAvailableColumnsController.php +++ b/src/DataObject/Controller/Grid/GetAvailableColumnsController.php @@ -59,7 +59,7 @@ public function __construct( )] #[IsGranted(UserPermissions::DATA_OBJECTS->value)] #[Get( - path: self::API_PATH . '/data-object/grid/available-columns/{classId}/folderId', + path: self::PREFIX . '/data-object/grid/available-columns/{classId}/folderId', operationId: 'data_object_get_available_grid_columns', description: 'data_object_get_available_grid_columns_description', summary: 'data_object_get_available_grid_columns_summary', diff --git a/src/DataObject/Controller/Grid/GetController.php b/src/DataObject/Controller/Grid/GetController.php index 59bc472a8..629c64484 100644 --- a/src/DataObject/Controller/Grid/GetController.php +++ b/src/DataObject/Controller/Grid/GetController.php @@ -53,7 +53,7 @@ public function __construct( #[Route('/data-objects/grid', name: 'pimcore_studio_api_get_data_object_grid', methods: ['POST'])] #[IsGranted(UserPermissions::ASSETS->value)] #[Post( - path: self::API_PATH . '/data-objects/grid', + path: self::PREFIX . '/data-objects/grid', operationId: 'data_object_get_grid', description: 'data_object_get_grid_description', summary: 'data_object_get_grid_summary', diff --git a/src/DataObject/Controller/PatchController.php b/src/DataObject/Controller/PatchController.php index 393a3c265..4b6a4592c 100644 --- a/src/DataObject/Controller/PatchController.php +++ b/src/DataObject/Controller/PatchController.php @@ -61,7 +61,7 @@ public function __construct( #[Route('/data-objects', name: 'pimcore_studio_api_patch_data_object', methods: ['PATCH'])] #[IsGranted(UserPermissions::DATA_OBJECTS->value)] #[Patch( - path: self::API_PATH . '/data-objects', + path: self::PREFIX . '/data-objects', operationId: 'data_object_patch_by_id', description: 'data_object_patch_by_id_description', summary: 'data_object_patch_by_id_summary', diff --git a/src/DataObject/Controller/ReplaceController.php b/src/DataObject/Controller/ReplaceController.php index 1d3b74ff8..6bdb351d4 100644 --- a/src/DataObject/Controller/ReplaceController.php +++ b/src/DataObject/Controller/ReplaceController.php @@ -62,7 +62,7 @@ public function __construct( )] #[IsGranted(UserPermissions::DATA_OBJECTS->value)] #[Post( - path: self::API_PATH . '/data-objects/{sourceId}/replace/{targetId}', + path: self::PREFIX . '/data-objects/{sourceId}/replace/{targetId}', operationId: 'data_object_replace_content', description: 'data_object_replace_content_description', summary: 'data_object_replace_content_summary', diff --git a/src/DataObject/Controller/TreeController.php b/src/DataObject/Controller/TreeController.php index 6279c83c0..cda52da8d 100644 --- a/src/DataObject/Controller/TreeController.php +++ b/src/DataObject/Controller/TreeController.php @@ -68,7 +68,7 @@ public function __construct( #[Route('/data-objects/tree', name: 'pimcore_studio_api_data_objects_tree', methods: ['GET'])] #[IsGranted(UserPermissions::DATA_OBJECTS->value)] #[Get( - path: self::API_PATH . '/data-objects/tree', + path: self::PREFIX . '/data-objects/tree', operationId: 'data_object_get_tree', description: 'data_object_get_tree_description', summary: 'data_object_get_tree_summary', diff --git a/src/DataObject/Controller/UpdateController.php b/src/DataObject/Controller/UpdateController.php index 8802fe546..5fbb281ca 100644 --- a/src/DataObject/Controller/UpdateController.php +++ b/src/DataObject/Controller/UpdateController.php @@ -52,7 +52,7 @@ public function __construct( #[Route('/data-objects/{id}', name: 'pimcore_studio_api_update_data_object', methods: ['PUT'])] #[IsGranted(UserPermissions::DATA_OBJECTS->value)] #[Put( - path: self::API_PATH . '/data-objects/{id}', + path: self::PREFIX . '/data-objects/{id}', operationId: 'data_object_update_by_id', description: 'data_object_update_by_id_description', summary: 'data_object_update_by_id_summary', diff --git a/src/Dependency/Controller/Element/CollectionController.php b/src/Dependency/Controller/Element/CollectionController.php index ee52a9418..3dc663377 100644 --- a/src/Dependency/Controller/Element/CollectionController.php +++ b/src/Dependency/Controller/Element/CollectionController.php @@ -59,7 +59,7 @@ public function __construct( #[Route('/dependencies/{elementType}/{id}', name: 'pimcore_studio_api_dependencies', methods: ['GET'])] #[IsGranted(UserPermissions::ELEMENT_TYPE_PERMISSION->value)] #[Get( - path: self::API_PATH . '/dependencies/{elementType}/{id}', + path: self::PREFIX . '/dependencies/{elementType}/{id}', operationId: 'dependency_get_collection_by_element_type', description: 'Get paginated dependencies. Pass dependency mode to get either all elements that depend on the provided element diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index 68fb29e53..2dd735a35 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -44,6 +44,7 @@ public function getConfigTreeBuilder(): TreeBuilder $rootNode = $treeBuilder->getRootNode(); $rootNode->addDefaultsIfNotSet(); + $this->addUrlPrefix($rootNode); $this->addOpenApiScanPathsNode($rootNode); $this->addApiTokenNode($rootNode); $this->addAllowedHostsForCorsNode($rootNode); @@ -59,6 +60,14 @@ public function getConfigTreeBuilder(): TreeBuilder return $treeBuilder; } + private function addUrlPrefix(ArrayNodeDefinition $node): void + { + $node->children() + ->scalarNode('url_prefix') + ->defaultValue('/pimcore-studio/api') + ->end(); + } + private function addOpenApiScanPathsNode(ArrayNodeDefinition $node): void { $node->children() diff --git a/src/DependencyInjection/PimcoreStudioBackendExtension.php b/src/DependencyInjection/PimcoreStudioBackendExtension.php index b81258a8c..0d2bc3edb 100644 --- a/src/DependencyInjection/PimcoreStudioBackendExtension.php +++ b/src/DependencyInjection/PimcoreStudioBackendExtension.php @@ -67,6 +67,7 @@ public function load(array $configs, ContainerBuilder $container): void $this->checkValidOpenApiScanPaths($config['open_api_scan_paths']); $definition = $container->getDefinition(OpenApiServiceInterface::class); + $definition->setArgument('$routePrefix', rtrim($config['url_prefix'], '/')); $definition->setArgument('$openApiScanPaths', $config['open_api_scan_paths']); $definition = $container->getDefinition(CorsSubscriber::class); @@ -92,17 +93,20 @@ public function load(array $configs, ContainerBuilder $container): void $definition = $container->getDefinition(NoteServiceInterface::class); $definition->setArgument('$noteTypes', $config['notes']['types']); - } public function prepend(ContainerBuilder $container): void { + if (!$container->hasParameter('pimcore_studio_backend.firewall_settings')) { $containerConfig = ConfigurationHelper::getConfigNodeFromSymfonyTree($container, 'pimcore_studio_backend'); $container->setParameter('pimcore_studio_backend.firewall_settings', $containerConfig['security_firewall']); } $containerConfig = ConfigurationHelper::getConfigNodeFromSymfonyTree($container, 'pimcore_studio_backend'); + + $container->setParameter('pimcore_studio_backend.url_prefix', rtrim($containerConfig['url_prefix'], '/')); + foreach ($containerConfig['mercure_settings'] as $key => $setting) { if ($container->hasParameter('pimcore_studio_backend.mercure_settings.' . $key)) { continue; diff --git a/src/Element/Controller/DeleteController.php b/src/Element/Controller/DeleteController.php index c226a7299..f55f9c723 100644 --- a/src/Element/Controller/DeleteController.php +++ b/src/Element/Controller/DeleteController.php @@ -67,7 +67,7 @@ public function __construct( #[Route('/elements/{elementType}/delete/{id}', name: 'pimcore_studio_api_elements_delete', methods: ['DELETE'])] #[IsGranted(UserPermissions::DATA_OBJECTS->value)] #[Delete( - path: self::API_PATH . '/elements/{elementType}/delete/{id}', + path: self::PREFIX . '/elements/{elementType}/delete/{id}', operationId: 'element_delete', description: 'element_delete_description', summary: 'element_delete_summary', diff --git a/src/Element/Controller/DeleteInfoController.php b/src/Element/Controller/DeleteInfoController.php index ca05741e9..e2d9af381 100644 --- a/src/Element/Controller/DeleteInfoController.php +++ b/src/Element/Controller/DeleteInfoController.php @@ -57,7 +57,7 @@ public function __construct( )] #[IsGranted(UserPermissions::ELEMENT_TYPE_PERMISSION->value)] #[Get( - path: self::API_PATH . '/elements/{elementType}/delete-info/{id}', + path: self::PREFIX . '/elements/{elementType}/delete-info/{id}', operationId: 'element_get_delete_info', description: 'element_get_delete_info_description', summary: 'element_get_delete_info_summary', diff --git a/src/Element/Controller/FolderController.php b/src/Element/Controller/FolderController.php index 46a846cc5..2fcbb9110 100644 --- a/src/Element/Controller/FolderController.php +++ b/src/Element/Controller/FolderController.php @@ -68,7 +68,7 @@ public function __construct( )] #[IsGranted(UserPermissions::ELEMENT_TYPE_PERMISSION->value)] #[Post( - path: self::API_PATH . '/elements/{elementType}/folder/{parentId}', + path: self::PREFIX . '/elements/{elementType}/folder/{parentId}', operationId: 'element_folder_create', description: 'element_folder_create_description', summary: 'element_folder_create_summary', diff --git a/src/Element/Controller/GetIdByPathController.php b/src/Element/Controller/GetIdByPathController.php index 14b71de5d..97aa6ef96 100644 --- a/src/Element/Controller/GetIdByPathController.php +++ b/src/Element/Controller/GetIdByPathController.php @@ -56,7 +56,7 @@ public function __construct( )] #[IsGranted(UserPermissions::ELEMENT_TYPE_PERMISSION->value)] #[Get( - path: self::API_PATH . '/elements/{elementType}/path', + path: self::PREFIX . '/elements/{elementType}/path', operationId: 'element_get_id_by_path', description: 'element_get_id_by_path_description', summary: 'element_get_id_by_path_summary', diff --git a/src/Email/Controller/Blocklist/AddController.php b/src/Email/Controller/Blocklist/AddController.php index 51c6b1f7b..0f026c2ac 100644 --- a/src/Email/Controller/Blocklist/AddController.php +++ b/src/Email/Controller/Blocklist/AddController.php @@ -53,7 +53,7 @@ public function __construct( #[Route('/emails/blocklist', name: 'pimcore_studio_api_emails_blocklist_add', methods: ['POST'])] #[IsGranted(UserPermissions::EMAILS->value)] #[Post( - path: self::API_PATH . '/emails/blocklist', + path: self::PREFIX . '/emails/blocklist', operationId: 'email_blocklist_add', description: 'email_blocklist_add_description', summary: 'email_blocklist_add_summary', diff --git a/src/Email/Controller/Blocklist/CollectionController.php b/src/Email/Controller/Blocklist/CollectionController.php index 98161c0eb..f8ad52ac7 100644 --- a/src/Email/Controller/Blocklist/CollectionController.php +++ b/src/Email/Controller/Blocklist/CollectionController.php @@ -60,7 +60,7 @@ public function __construct( #[Route('/emails/blocklist', name: 'pimcore_studio_api_emails_blocklist_list', methods: ['GET'])] #[IsGranted(UserPermissions::EMAILS->value)] #[Get( - path: self::API_PATH . '/emails/blocklist', + path: self::PREFIX . '/emails/blocklist', operationId: 'email_blocklist_get_collection', description: 'email_blocklist_get_collection_description', summary: 'email_blocklist_get_collection_summary', diff --git a/src/Email/Controller/Blocklist/DeleteController.php b/src/Email/Controller/Blocklist/DeleteController.php index 6e9f20593..f76cd71e4 100644 --- a/src/Email/Controller/Blocklist/DeleteController.php +++ b/src/Email/Controller/Blocklist/DeleteController.php @@ -54,7 +54,7 @@ public function __construct( #[Route('/emails/blocklist', name: 'pimcore_studio_api_emails_blocklist_delete', methods: ['DELETE'])] #[IsGranted(UserPermissions::EMAILS->value)] #[Delete( - path: self::API_PATH . '/emails/blocklist', + path: self::PREFIX . '/emails/blocklist', operationId: 'email_blocklist_delete', description: 'email_blocklist_delete_description', summary: 'email_blocklist_delete_summary', diff --git a/src/Email/Controller/CollectionController.php b/src/Email/Controller/CollectionController.php index 50be8ecd7..5e56a9861 100644 --- a/src/Email/Controller/CollectionController.php +++ b/src/Email/Controller/CollectionController.php @@ -59,7 +59,7 @@ public function __construct( #[IsGranted(UserPermissions::EMAILS->value)] #[IsGranted(UserPermissions::GDPR->value)] #[Get( - path: self::API_PATH . '/emails', + path: self::PREFIX . '/emails', operationId: 'email_log_get_collection', description: 'email_log_get_collection_description', summary: 'email_log_get_collection_summary', diff --git a/src/Email/Controller/DeleteController.php b/src/Email/Controller/DeleteController.php index 0f2db17dd..b2036c160 100644 --- a/src/Email/Controller/DeleteController.php +++ b/src/Email/Controller/DeleteController.php @@ -52,7 +52,7 @@ public function __construct( #[Route('/emails/{id}', name: 'pimcore_studio_api_emails_list_delete', methods: ['DELETE'])] #[IsGranted(UserPermissions::EMAILS->value)] #[Delete( - path: self::API_PATH . '/emails/{id}', + path: self::PREFIX . '/emails/{id}', operationId: 'email_log_delete', description: 'email_log_delete_description', summary: 'email_log_delete_summary', diff --git a/src/Email/Controller/Detail/EmailHtmlController.php b/src/Email/Controller/Detail/EmailHtmlController.php index 72d07285d..10e3efbba 100644 --- a/src/Email/Controller/Detail/EmailHtmlController.php +++ b/src/Email/Controller/Detail/EmailHtmlController.php @@ -56,7 +56,7 @@ public function __construct( #[Route('/emails/{id}/html', name: 'pimcore_studio_api_emails_log_html', methods: ['GET'])] #[IsGranted(UserPermissions::EMAILS->value)] #[Get( - path: self::API_PATH . '/emails/{id}/html', + path: self::PREFIX . '/emails/{id}/html', operationId: 'email_log_get_html', description: 'email_log_get_html_description', summary: 'email_log_get_html_summary', diff --git a/src/Email/Controller/Detail/EmailParamsController.php b/src/Email/Controller/Detail/EmailParamsController.php index c27597d2c..ca9bb9267 100644 --- a/src/Email/Controller/Detail/EmailParamsController.php +++ b/src/Email/Controller/Detail/EmailParamsController.php @@ -56,7 +56,7 @@ public function __construct( #[Route('/emails/{id}/params', name: 'pimcore_studio_api_emails_log_params', methods: ['GET'])] #[IsGranted(UserPermissions::EMAILS->value)] #[Get( - path: self::API_PATH . '/emails/{id}/params', + path: self::PREFIX . '/emails/{id}/params', operationId: 'email_log_get_params', description: 'email_log_get_params_description', summary: 'email_log_get_params_summary', diff --git a/src/Email/Controller/Detail/EmailTextController.php b/src/Email/Controller/Detail/EmailTextController.php index caf639e3f..4f2b79569 100644 --- a/src/Email/Controller/Detail/EmailTextController.php +++ b/src/Email/Controller/Detail/EmailTextController.php @@ -56,7 +56,7 @@ public function __construct( #[Route('/emails/{id}/text', name: 'pimcore_studio_api_emails_log_text', methods: ['GET'])] #[IsGranted(UserPermissions::EMAILS->value)] #[Get( - path: self::API_PATH . '/emails/{id}/text', + path: self::PREFIX . '/emails/{id}/text', operationId: 'email_log_get_text', description: 'email_log_get_text_description', summary: 'email_log_get_text_summary', diff --git a/src/Email/Controller/Detail/GetController.php b/src/Email/Controller/Detail/GetController.php index 1a32884ab..1808b956c 100644 --- a/src/Email/Controller/Detail/GetController.php +++ b/src/Email/Controller/Detail/GetController.php @@ -57,7 +57,7 @@ public function __construct( #[Route('/emails/{id}', name: 'pimcore_studio_api_emails_log_entry', methods: ['GET'])] #[IsGranted(UserPermissions::EMAILS->value)] #[Get( - path: self::API_PATH . '/emails/{id}', + path: self::PREFIX . '/emails/{id}', operationId: 'email_log_get_by_id', description: 'email_log_get_by_id_description', summary: 'email_log_get_by_id_summary', diff --git a/src/Email/Controller/ForwardController.php b/src/Email/Controller/ForwardController.php index 613bb8a5b..965ece06a 100644 --- a/src/Email/Controller/ForwardController.php +++ b/src/Email/Controller/ForwardController.php @@ -59,7 +59,7 @@ public function __construct( #[Route('/emails/{id}/forward', name: 'pimcore_studio_api_emails_forward', methods: ['POST'])] #[IsGranted(UserPermissions::EMAILS->value)] #[Post( - path: self::API_PATH . '/emails/{id}/forward', + path: self::PREFIX . '/emails/{id}/forward', operationId: 'email_log_forward_by_id', description: 'email_log_forward_by_id_description', summary: 'email_log_forward_by_id_summary', diff --git a/src/Email/Controller/ResendController.php b/src/Email/Controller/ResendController.php index 7df94bf8b..e7da94645 100644 --- a/src/Email/Controller/ResendController.php +++ b/src/Email/Controller/ResendController.php @@ -56,7 +56,7 @@ public function __construct( #[Route('/emails/{id}/resend', name: 'pimcore_studio_api_emails_resend', methods: ['POST'])] #[IsGranted(UserPermissions::EMAILS->value)] #[Post( - path: self::API_PATH . '/emails/{id}/resend', + path: self::PREFIX . '/emails/{id}/resend', operationId: 'email_log_resend_by_id', description: 'email_log_resend_by_id_description', summary: 'email_log_resend_by_id_summary', diff --git a/src/Email/Controller/TestEmailController.php b/src/Email/Controller/TestEmailController.php index 5e663fb0e..bc67f9260 100644 --- a/src/Email/Controller/TestEmailController.php +++ b/src/Email/Controller/TestEmailController.php @@ -61,7 +61,7 @@ public function __construct( #[Route('/emails/test', name: 'pimcore_studio_api_emails_test', methods: ['POST'])] #[IsGranted(UserPermissions::EMAILS->value)] #[Post( - path: self::API_PATH . '/emails/test', + path: self::PREFIX . '/emails/test', operationId: 'email_send_test', description: 'email_send_test_description', summary: 'email_send_test_summary', diff --git a/src/ExecutionEngine/Controller/AbortController.php b/src/ExecutionEngine/Controller/AbortController.php index 3cb9ab5c1..62ff8d0d4 100644 --- a/src/ExecutionEngine/Controller/AbortController.php +++ b/src/ExecutionEngine/Controller/AbortController.php @@ -51,7 +51,7 @@ public function __construct( #[Route('/execution-engine/abort/{jobRunId}', name: 'pimcore_studio_api_execution_engine_abort', methods: ['POST'])] #[IsGranted(UserPermissions::ASSETS->value)] #[Post( - path: self::API_PATH . '/execution-engine/abort/{JobRunId}', + path: self::PREFIX . '/execution-engine/abort/{JobRunId}', operationId: 'execution_engine_abort_job_run_by_id', description: 'execution_engine_abort_job_run_by_id_description', summary: 'execution_engine_abort_job_run_by_id_summary', diff --git a/src/Mercure/Controller/JwtController.php b/src/Mercure/Controller/JwtController.php index 7c0c8dc7f..f705e7943 100644 --- a/src/Mercure/Controller/JwtController.php +++ b/src/Mercure/Controller/JwtController.php @@ -40,7 +40,7 @@ public function __construct( #[Route('/mercure/auth', name: 'pimcore_studio_mercure_auth', methods: ['POST'])] #[Post( - path: self::API_PATH . '/mercure/auth', + path: self::PREFIX . '/mercure/auth', operationId: 'mercure_create_cookie', description: 'mercure_create_cookie_description', summary: 'mercure_create_cookie_summary', diff --git a/src/Note/Controller/CollectionController.php b/src/Note/Controller/CollectionController.php index 8df7adc43..5b52339d1 100644 --- a/src/Note/Controller/CollectionController.php +++ b/src/Note/Controller/CollectionController.php @@ -63,7 +63,7 @@ public function __construct( #[Route('/notes', name: 'pimcore_studio_api_get_notes', methods: ['GET'])] #[IsGranted(UserPermissions::NOTES_EVENTS->value)] #[Get( - path: self::API_PATH . '/notes', + path: self::PREFIX . '/notes', operationId: 'note_get_collection', description: 'note_get_collection_description', summary: 'note_get_collection_summary', diff --git a/src/Note/Controller/DeleteController.php b/src/Note/Controller/DeleteController.php index b6e861faa..fc997c09e 100644 --- a/src/Note/Controller/DeleteController.php +++ b/src/Note/Controller/DeleteController.php @@ -49,7 +49,7 @@ public function __construct( #[Route('/notes/{id}', name: 'pimcore_studio_api_delete_note', methods: ['DELETE'])] #[IsGranted(UserPermissions::NOTES_EVENTS->value)] #[Delete( - path: self::API_PATH . '/notes/{id}', + path: self::PREFIX . '/notes/{id}', operationId: 'note_delete_by_id', description: 'note_delete_by_id_description', summary: 'note_delete_by_id_summary', diff --git a/src/Note/Controller/Element/CollectionController.php b/src/Note/Controller/Element/CollectionController.php index 91f16dc37..e8d23bc37 100644 --- a/src/Note/Controller/Element/CollectionController.php +++ b/src/Note/Controller/Element/CollectionController.php @@ -71,7 +71,7 @@ public function __construct( #[IsGranted(UserPermissions::ELEMENT_TYPE_PERMISSION->value)] #[IsGranted(UserPermissions::NOTES_EVENTS->value)] #[Get( - path: self::API_PATH . '/notes/{elementType}/{id}', + path: self::PREFIX . '/notes/{elementType}/{id}', operationId: 'note_element_get_collection', description: 'note_element_get_collection_description', summary: 'note_element_get_collection_summary', diff --git a/src/Note/Controller/Element/CreateController.php b/src/Note/Controller/Element/CreateController.php index e164682dc..6bf8fdd77 100644 --- a/src/Note/Controller/Element/CreateController.php +++ b/src/Note/Controller/Element/CreateController.php @@ -59,7 +59,7 @@ public function __construct( #[IsGranted(UserPermissions::ELEMENT_TYPE_PERMISSION->value)] #[IsGranted(UserPermissions::NOTES_EVENTS->value)] #[Post( - path: self::API_PATH . '/notes/{elementType}/{id}', + path: self::PREFIX . '/notes/{elementType}/{id}', operationId: 'note_element_create', description: 'note_element_create_description', summary: 'note_element_create_summary', diff --git a/src/Note/Controller/Element/TypeController.php b/src/Note/Controller/Element/TypeController.php index 268f56378..084ad249a 100644 --- a/src/Note/Controller/Element/TypeController.php +++ b/src/Note/Controller/Element/TypeController.php @@ -51,7 +51,7 @@ public function __construct( #[IsGranted(UserPermissions::ELEMENT_TYPE_PERMISSION->value)] #[IsGranted(UserPermissions::NOTES_EVENTS->value)] #[Get( - path: self::API_PATH . '/notes/type/{elementType}', + path: self::PREFIX . '/notes/type/{elementType}', operationId: 'note_element_get_type_collection', description: 'note_element_get_type_collection_description', summary: 'note_element_get_type_collection_summary', diff --git a/src/Notification/Controller/CollectionController.php b/src/Notification/Controller/CollectionController.php index 48d31bc52..ca7ba49b5 100644 --- a/src/Notification/Controller/CollectionController.php +++ b/src/Notification/Controller/CollectionController.php @@ -59,7 +59,7 @@ public function __construct( #[Route('/notifications', name: 'pimcore_studio_api_notifications_list', methods: ['POST'])] #[IsGranted(UserPermissions::NOTIFICATIONS->value)] #[Post( - path: self::API_PATH . '/notifications', + path: self::PREFIX . '/notifications', operationId: 'notification_get_collection', description: 'notification_get_collection_description', summary: 'notification_get_collection_summary', diff --git a/src/Notification/Controller/DeleteAllController.php b/src/Notification/Controller/DeleteAllController.php index edeb4ec46..5e8fc5a20 100644 --- a/src/Notification/Controller/DeleteAllController.php +++ b/src/Notification/Controller/DeleteAllController.php @@ -48,7 +48,7 @@ public function __construct( #[Route('/notifications', name: 'pimcore_studio_api_delete_all_notifications', methods: ['DELETE'])] #[IsGranted(UserPermissions::NOTIFICATIONS->value)] #[Delete( - path: self::API_PATH . '/notifications', + path: self::PREFIX . '/notifications', operationId: 'notification_delete_all', description: 'notification_delete_all_description', summary: 'notification_delete_all_summary', diff --git a/src/Notification/Controller/DeleteController.php b/src/Notification/Controller/DeleteController.php index e15162f88..a6880b219 100644 --- a/src/Notification/Controller/DeleteController.php +++ b/src/Notification/Controller/DeleteController.php @@ -51,7 +51,7 @@ public function __construct( #[Route('/notifications/{id}', name: 'pimcore_studio_api_delete_notification', methods: ['DELETE'])] #[IsGranted(UserPermissions::NOTIFICATIONS->value)] #[Delete( - path: self::API_PATH . '/notifications/{id}', + path: self::PREFIX . '/notifications/{id}', operationId: 'notification_delete_by_id', description: 'notification_delete_by_id_description', summary: 'notification_delete_by_id_summary', diff --git a/src/Notification/Controller/GetController.php b/src/Notification/Controller/GetController.php index c6a4d5bd6..3d78eacd6 100644 --- a/src/Notification/Controller/GetController.php +++ b/src/Notification/Controller/GetController.php @@ -53,7 +53,7 @@ public function __construct( #[Route('/notifications/{id}', name: 'pimcore_studio_api_notification_get', methods: ['GET'])] #[IsGranted(UserPermissions::NOTIFICATIONS->value)] #[Get( - path: self::API_PATH . '/notifications/{id}', + path: self::PREFIX . '/notifications/{id}', operationId: 'notification_get_by_id', description: 'notification_get_by_id_description', summary: 'notification_get_by_id_summary', diff --git a/src/Notification/Controller/ReadController.php b/src/Notification/Controller/ReadController.php index d82d100da..9396a4313 100644 --- a/src/Notification/Controller/ReadController.php +++ b/src/Notification/Controller/ReadController.php @@ -56,7 +56,7 @@ public function __construct( ] #[IsGranted(UserPermissions::NOTIFICATIONS->value)] #[POST( - path: self::API_PATH . '/notifications/{id}', + path: self::PREFIX . '/notifications/{id}', operationId: 'notification_read_by_id', description: 'notification_read_by_id_description', summary: 'notification_read_by_id_summary', diff --git a/src/Notification/Controller/SendController.php b/src/Notification/Controller/SendController.php index 90ffa3769..4103d05bb 100644 --- a/src/Notification/Controller/SendController.php +++ b/src/Notification/Controller/SendController.php @@ -61,7 +61,7 @@ public function __construct( #[Route('/notifications/send', name: 'pimcore_studio_api_notification_send', methods: ['POST'])] #[IsGranted(UserPermissions::NOTIFICATIONS_SEND->value)] #[Post( - path: self::API_PATH . '/notifications/send', + path: self::PREFIX . '/notifications/send', operationId: 'notification_send', description: 'notification_send_description', summary: 'notification_send_summary', diff --git a/src/OpenApi/Service/OpenApiService.php b/src/OpenApi/Service/OpenApiService.php index 7018339c2..fe192d8cb 100644 --- a/src/OpenApi/Service/OpenApiService.php +++ b/src/OpenApi/Service/OpenApiService.php @@ -18,6 +18,7 @@ use JsonException; use OpenApi\Annotations\OpenApi; +use OpenApi\Annotations\PathItem; use OpenApi\Attributes\Schema; use OpenApi\Generator; use Pimcore\Bundle\StudioBackendBundle\Exception\Api\EnvironmentException; @@ -32,6 +33,7 @@ public function __construct( private TranslatorServiceInterface $translator, + private string $routePrefix, private array $openApiScanPaths = [] ) { } @@ -42,6 +44,16 @@ public function getConfig(): OpenApi if ($config) { usort($config->components->schemas, [$this, 'sortSchemas']); + + // replace the configurable prefix in the paths + $prefix = $this->routePrefix; + $config->paths = array_map( + static function(PathItem $pathItem) use($prefix) { + $pathItem->path = str_replace('{prefix}', $prefix, $pathItem->path); + return $pathItem; + }, + $config->paths + ); } return $config; diff --git a/src/Property/Controller/CollectionController.php b/src/Property/Controller/CollectionController.php index 1f1b26c10..f5aa8f23a 100644 --- a/src/Property/Controller/CollectionController.php +++ b/src/Property/Controller/CollectionController.php @@ -50,7 +50,7 @@ public function __construct( #[Route('/properties', name: 'pimcore_studio_api_properties', methods: ['GET'])] #[Get( - path: self::API_PATH . '/properties', + path: self::PREFIX . '/properties', operationId: 'property_get_collection', description: 'property_get_collection_description', summary: 'property_get_collection_summary', diff --git a/src/Property/Controller/CreateController.php b/src/Property/Controller/CreateController.php index c95a7a1eb..7d1cb6983 100644 --- a/src/Property/Controller/CreateController.php +++ b/src/Property/Controller/CreateController.php @@ -50,7 +50,7 @@ public function __construct( #[Route('/property', name: 'pimcore_studio_api_property_create', methods: ['POST'])] #[IsGranted(UserPermissions::PREDEFINED_PROPERTIES->value)] #[POST( - path: self::API_PATH . '/property', + path: self::PREFIX . '/property', operationId: 'property_create', description: 'property_create_description', summary: 'property_create_summary', diff --git a/src/Property/Controller/DeleteController.php b/src/Property/Controller/DeleteController.php index 403276706..91dab6eed 100644 --- a/src/Property/Controller/DeleteController.php +++ b/src/Property/Controller/DeleteController.php @@ -50,7 +50,7 @@ public function __construct( #[Route('/properties/{id}', name: 'pimcore_studio_api_delete_properties', methods: ['DELETE'])] #[IsGranted(UserPermissions::PREDEFINED_PROPERTIES->value)] #[Delete( - path: self::API_PATH . '/properties/{id}', + path: self::PREFIX . '/properties/{id}', operationId: 'property_delete', description: 'property_delete_description', summary: 'property_delete_summary', diff --git a/src/Property/Controller/Element/CollectionController.php b/src/Property/Controller/Element/CollectionController.php index 6f35b2296..fe6348950 100644 --- a/src/Property/Controller/Element/CollectionController.php +++ b/src/Property/Controller/Element/CollectionController.php @@ -54,7 +54,7 @@ public function __construct( #[Route('/properties/{elementType}/{id}', name: 'pimcore_studio_api_get_element_properties', methods: ['GET'])] #[IsGranted(UserPermissions::ELEMENT_TYPE_PERMISSION->value)] #[Get( - path: self::API_PATH . '/properties/{elementType}/{id}', + path: self::PREFIX . '/properties/{elementType}/{id}', operationId: 'property_get_collection_for_element_by_type_and_id', description: 'property_get_collection_for_element_by_type_and_id_description', summary: 'property_get_collection_for_element_by_type_and_id_summary', diff --git a/src/Property/Controller/UpdateController.php b/src/Property/Controller/UpdateController.php index 887a6f974..c5f008b1f 100644 --- a/src/Property/Controller/UpdateController.php +++ b/src/Property/Controller/UpdateController.php @@ -55,7 +55,7 @@ public function __construct( #[Route('/properties/{id}', name: 'pimcore_studio_api_update_property', methods: ['PUT'])] #[IsGranted(UserPermissions::PREDEFINED_PROPERTIES->value)] #[Put( - path: self::API_PATH . '/properties/{id}', + path: self::PREFIX . '/properties/{id}', operationId: 'property_update', description: 'property_update_description', summary: 'property_update_summary', diff --git a/src/Role/Controller/CloneController.php b/src/Role/Controller/CloneController.php index 781a46fbd..9d14d768b 100644 --- a/src/Role/Controller/CloneController.php +++ b/src/Role/Controller/CloneController.php @@ -55,7 +55,7 @@ public function __construct( #[Route('/role/clone/{id}', name: 'pimcore_studio_api_role_clone', methods: ['POST'])] #[IsGranted(UserPermissions::USER_MANAGEMENT->value)] #[Post( - path: self::API_PATH . '/role/clone/{id}', + path: self::PREFIX . '/role/clone/{id}', operationId: 'role_clone_by_id', summary: 'role_clone_by_id_summary', tags: [Tags::Role->value] diff --git a/src/Role/Controller/CreateFolderController.php b/src/Role/Controller/CreateFolderController.php index 902a44d5d..7d9ac688a 100644 --- a/src/Role/Controller/CreateFolderController.php +++ b/src/Role/Controller/CreateFolderController.php @@ -54,7 +54,7 @@ public function __construct( #[Route('/role/folder', name: 'pimcore_studio_api_role_folder_create', methods: ['POST'])] #[IsGranted(UserPermissions::USER_MANAGEMENT->value)] #[Post( - path: self::API_PATH . '/role/folder', + path: self::PREFIX . '/role/folder', operationId: 'role_folder_create', summary: 'role_folder_create_summary', tags: [Tags::Role->value] diff --git a/src/Role/Controller/CreateRoleController.php b/src/Role/Controller/CreateRoleController.php index be1179eac..2a104e4f8 100644 --- a/src/Role/Controller/CreateRoleController.php +++ b/src/Role/Controller/CreateRoleController.php @@ -54,7 +54,7 @@ public function __construct( #[Route('/role', name: 'pimcore_studio_api_role_create', methods: ['POST'])] #[IsGranted(UserPermissions::USER_MANAGEMENT->value)] #[Post( - path: self::API_PATH . '/role', + path: self::PREFIX . '/role', operationId: 'role_create', summary: 'role_create_summary', tags: [Tags::Role->value] diff --git a/src/Role/Controller/DeleteFolderController.php b/src/Role/Controller/DeleteFolderController.php index 2a761949a..e382172de 100644 --- a/src/Role/Controller/DeleteFolderController.php +++ b/src/Role/Controller/DeleteFolderController.php @@ -50,7 +50,7 @@ public function __construct( #[Route('/role/folder/{id}', name: 'pimcore_studio_api_role_folder_delete', methods: ['DELETE'])] #[IsGranted(UserPermissions::USER_MANAGEMENT->value)] #[Delete( - path: self::API_PATH . '/role/folder/{id}', + path: self::PREFIX . '/role/folder/{id}', operationId: 'role_folder_delete_by_id', summary: 'role_folder_delete_by_id_summary', tags: [Tags::Role->value] diff --git a/src/Role/Controller/DeleteRoleController.php b/src/Role/Controller/DeleteRoleController.php index 2076217a5..744d140c6 100644 --- a/src/Role/Controller/DeleteRoleController.php +++ b/src/Role/Controller/DeleteRoleController.php @@ -51,7 +51,7 @@ public function __construct( #[Route('/role/{id}', name: 'pimcore_studio_api_role_delete', methods: ['DELETE'])] #[IsGranted(UserPermissions::USER_MANAGEMENT->value)] #[Delete( - path: self::API_PATH . '/role/{id}', + path: self::PREFIX . '/role/{id}', operationId: 'role_delete_by_id', summary: 'role_delete_by_id_summary', tags: [Tags::Role->value] diff --git a/src/Role/Controller/GetRoleController.php b/src/Role/Controller/GetRoleController.php index 72cdcb401..2e9ecf81d 100644 --- a/src/Role/Controller/GetRoleController.php +++ b/src/Role/Controller/GetRoleController.php @@ -55,7 +55,7 @@ public function __construct( #[Route('/role/{id}', name: 'pimcore_studio_api_role_get', methods: ['GET'])] #[IsGranted(UserPermissions::USER_MANAGEMENT->value)] #[Get( - path: self::API_PATH . '/role/{id}', + path: self::PREFIX . '/role/{id}', operationId: 'role_get_by_id', summary: 'role_get_by_id_summary', tags: [Tags::Role->value] diff --git a/src/Role/Controller/GetRolesController.php b/src/Role/Controller/GetRolesController.php index 35afd8831..4fe2e31bc 100644 --- a/src/Role/Controller/GetRolesController.php +++ b/src/Role/Controller/GetRolesController.php @@ -49,7 +49,7 @@ public function __construct( #[Route('/roles', name: 'pimcore_studio_api_roles', methods: ['GET'])] #[IsGranted(UserPermissions::USER_MANAGEMENT->value)] #[Get( - path: self::API_PATH . '/roles', + path: self::PREFIX . '/roles', operationId: 'role_get_collection', description: 'role_get_collection_description', summary: 'role_get_collection_summary', diff --git a/src/Role/Controller/RoleTreeController.php b/src/Role/Controller/RoleTreeController.php index da512bb16..71a4d8294 100644 --- a/src/Role/Controller/RoleTreeController.php +++ b/src/Role/Controller/RoleTreeController.php @@ -56,7 +56,7 @@ public function __construct( #[Route('/roles/tree', name: 'pimcore_studio_api_role_tree', methods: ['GET'])] #[IsGranted(UserPermissions::USER_MANAGEMENT->value)] #[Get( - path: self::API_PATH . '/roles/tree', + path: self::PREFIX . '/roles/tree', operationId: 'role_get_tree', summary: 'role_get_tree_summary', tags: [Tags::Role->value] diff --git a/src/Role/Controller/UpdateRoleController.php b/src/Role/Controller/UpdateRoleController.php index b634c02e2..da7e03032 100644 --- a/src/Role/Controller/UpdateRoleController.php +++ b/src/Role/Controller/UpdateRoleController.php @@ -59,7 +59,7 @@ public function __construct( #[Route('/role/{id}', name: 'pimcore_studio_api_role_update', methods: ['PUT'])] #[IsGranted(UserPermissions::USER_MANAGEMENT->value)] #[Put( - path: self::API_PATH . '/role/{id}', + path: self::PREFIX . '/role/{id}', operationId: 'role_update_by_id', summary: 'role_update_by_id_summary', tags: [Tags::Role->value] diff --git a/src/Schedule/Controller/DeleteController.php b/src/Schedule/Controller/DeleteController.php index be0dfb0d1..66cb753e7 100644 --- a/src/Schedule/Controller/DeleteController.php +++ b/src/Schedule/Controller/DeleteController.php @@ -51,7 +51,7 @@ public function __construct( #[Route('/schedules/{id}', name: 'pimcore_studio_api_delete_schedule', methods: ['DELETE'])] #[IsGranted(UserPermissions::PIMCORE_USER->value)] #[Delete( - path: self::API_PATH . '/schedules/{id}', + path: self::PREFIX . '/schedules/{id}', operationId: 'schedule_delete_by_id', description: 'schedule_delete_by_id_description', summary: 'schedule_delete_by_id_summary', diff --git a/src/Schedule/Controller/Element/CollectionController.php b/src/Schedule/Controller/Element/CollectionController.php index 7b6b64d6c..245ccbd80 100644 --- a/src/Schedule/Controller/Element/CollectionController.php +++ b/src/Schedule/Controller/Element/CollectionController.php @@ -52,7 +52,7 @@ public function __construct( #[Route('/schedules/{elementType}/{id}', name: 'pimcore_studio_api_get_element_schedules', methods: ['GET'])] #[IsGranted(UserPermissions::ELEMENT_TYPE_PERMISSION->value)] #[Get( - path: self::API_PATH . '/schedules/{elementType}/{id}', + path: self::PREFIX . '/schedules/{elementType}/{id}', operationId: 'schedule_get_collection_for_element_by_type_and_id', description: 'schedule_get_collection_for_element_by_type_and_id_description', summary: 'schedule_get_collection_for_element_by_type_and_id_summary', diff --git a/src/Schedule/Controller/Element/CreateController.php b/src/Schedule/Controller/Element/CreateController.php index e479cd983..683966860 100644 --- a/src/Schedule/Controller/Element/CreateController.php +++ b/src/Schedule/Controller/Element/CreateController.php @@ -54,7 +54,7 @@ public function __construct( #[Route('/schedules/{elementType}/{id}', name: 'pimcore_studio_api_create_schedule', methods: ['POST'])] #[IsGranted(UserPermissions::ELEMENT_TYPE_PERMISSION->value)] #[POST( - path: self::API_PATH . '/schedules/{elementType}/{id}', + path: self::PREFIX . '/schedules/{elementType}/{id}', operationId: 'schedule_create_for_element_by_type_and_id', description: 'schedule_create_for_element_by_type_and_id_description', summary: 'schedule_create_for_element_by_type_and_id_summary', diff --git a/src/Schedule/Controller/Element/UpdateController.php b/src/Schedule/Controller/Element/UpdateController.php index b96f14bbc..0747ae215 100644 --- a/src/Schedule/Controller/Element/UpdateController.php +++ b/src/Schedule/Controller/Element/UpdateController.php @@ -59,7 +59,7 @@ public function __construct( #[Route('/schedules/{elementType}/{id}', name: 'pimcore_studio_api_update_schedules', methods: ['PUT'])] #[IsGranted(UserPermissions::ELEMENT_TYPE_PERMISSION->value)] #[Put( - path: self::API_PATH . '/schedules/{elementType}/{id}', + path: self::PREFIX . '/schedules/{elementType}/{id}', operationId: 'schedule_update_for_element_by_type_and_id', description: 'schedule_update_for_element_by_type_and_id_description', summary: 'schedule_update_for_element_by_type_and_id_summary', diff --git a/src/Setting/Controller/GetController.php b/src/Setting/Controller/GetController.php index b48839ac1..18bb9ce8b 100644 --- a/src/Setting/Controller/GetController.php +++ b/src/Setting/Controller/GetController.php @@ -43,7 +43,7 @@ public function __construct( #[Route(path: self::ROUTE, name: 'pimcore_studio_api_settings', methods: ['GET'])] #[Get( - path: self::API_PATH . self::ROUTE, + path: self::PREFIX . self::ROUTE, operationId: 'system_settings_get', description: 'system_settings_get_description', summary: 'system_settings_get_summary', diff --git a/src/Tag/Controller/CollectionController.php b/src/Tag/Controller/CollectionController.php index 6f3c2c85c..a9832d368 100644 --- a/src/Tag/Controller/CollectionController.php +++ b/src/Tag/Controller/CollectionController.php @@ -60,7 +60,7 @@ public function __construct( #[Route('/tags', name: 'pimcore_studio_api_tags', methods: ['GET'])] #[IsGranted(UserPermissions::TAGS_SEARCH->value)] #[Get( - path: self::API_PATH . '/tags', + path: self::PREFIX . '/tags', operationId: 'tag_get_collection', description: 'tag_get_collection_description', summary: 'tag_get_collection_summary', diff --git a/src/Tag/Controller/CreateController.php b/src/Tag/Controller/CreateController.php index 6e3752af8..2d36031ca 100644 --- a/src/Tag/Controller/CreateController.php +++ b/src/Tag/Controller/CreateController.php @@ -52,7 +52,7 @@ public function __construct( */ #[Route('/tag', name: 'pimcore_studio_api_create_tag', methods: ['POST'])] #[POST( - path: self::API_PATH . '/tag', + path: self::PREFIX . '/tag', operationId: 'tag_create', description: 'tag_create_description', summary: 'tag_create_summary', diff --git a/src/Tag/Controller/DeleteController.php b/src/Tag/Controller/DeleteController.php index 53e6e2201..da5ba6b56 100644 --- a/src/Tag/Controller/DeleteController.php +++ b/src/Tag/Controller/DeleteController.php @@ -51,7 +51,7 @@ public function __construct( #[Route('/tags/{id}', name: 'pimcore_studio_api_delete_tags', methods: ['DELETE'])] #[IsGranted(UserPermissions::TAGS_CONFIGURATION->value)] #[Delete( - path: self::API_PATH . '/tags/{id}', + path: self::PREFIX . '/tags/{id}', operationId: 'tag_delete_by_id', description: 'tag_delete_by_id_description', summary: 'tag_delete_by_id_summary', diff --git a/src/Tag/Controller/Element/AssignController.php b/src/Tag/Controller/Element/AssignController.php index 72a89e153..53b3d9d2f 100644 --- a/src/Tag/Controller/Element/AssignController.php +++ b/src/Tag/Controller/Element/AssignController.php @@ -55,7 +55,7 @@ public function __construct( ] #[IsGranted(UserPermissions::TAGS_ASSIGNMENT->value)] #[Post( - path: self::API_PATH . '/tags/assign/{elementType}/{id}/{tagId}', + path: self::PREFIX . '/tags/assign/{elementType}/{id}/{tagId}', operationId: 'tag_assign_to_element', description: 'tag_assign_to_element_description', summary: 'tag_assign_to_element_summary', diff --git a/src/Tag/Controller/Element/BatchAssignController.php b/src/Tag/Controller/Element/BatchAssignController.php index 43908351e..fe09f2765 100644 --- a/src/Tag/Controller/Element/BatchAssignController.php +++ b/src/Tag/Controller/Element/BatchAssignController.php @@ -58,7 +58,7 @@ public function __construct( )] #[IsGranted(UserPermissions::TAGS_ASSIGNMENT->value)] #[Post( - path: self::API_PATH . '/tags/batch/assign/{elementType}', + path: self::PREFIX . '/tags/batch/assign/{elementType}', operationId: 'tag_batch_assign_to_elements_by_type', description: 'tag_batch_assign_to_elements_by_type_description', summary: 'tag_batch_assign_to_elements_by_type_summary', diff --git a/src/Tag/Controller/Element/BatchReplaceController.php b/src/Tag/Controller/Element/BatchReplaceController.php index 16074de55..4857507ff 100644 --- a/src/Tag/Controller/Element/BatchReplaceController.php +++ b/src/Tag/Controller/Element/BatchReplaceController.php @@ -58,7 +58,7 @@ public function __construct( )] #[IsGranted(UserPermissions::TAGS_ASSIGNMENT->value)] #[Post( - path: self::API_PATH . '/tags/batch/replace/{elementType}', + path: self::PREFIX . '/tags/batch/replace/{elementType}', operationId: 'tag_batch_replace_for_elements_by_type', description: 'tag_batch_replace_for_elements_by_type_description', summary: 'tag_batch_replace_for_elements_by_type_summary', diff --git a/src/Tag/Controller/Element/CollectionController.php b/src/Tag/Controller/Element/CollectionController.php index ec7d834e9..a2bd6d665 100644 --- a/src/Tag/Controller/Element/CollectionController.php +++ b/src/Tag/Controller/Element/CollectionController.php @@ -53,7 +53,7 @@ public function __construct( #[Route('/tags/{elementType}/{id}', name: 'pimcore_studio_api_get_element_tags', methods: ['GET'])] #[IsGranted(UserPermissions::TAGS_SEARCH->value)] #[Get( - path: self::API_PATH . '/tags/{elementType}/{id}', + path: self::PREFIX . '/tags/{elementType}/{id}', operationId: 'tag_get_collection_for_element_by_type_and_id', description: 'tag_get_collection_for_element_by_type_and_id_description', summary: 'tag_get_collection_for_element_by_type_and_id_summary', diff --git a/src/Tag/Controller/Element/UnassignController.php b/src/Tag/Controller/Element/UnassignController.php index 99d9d2567..71a235fd6 100644 --- a/src/Tag/Controller/Element/UnassignController.php +++ b/src/Tag/Controller/Element/UnassignController.php @@ -51,7 +51,7 @@ public function __construct( #[Route('/tags/{elementType}/{id}/{tagId}', name: 'pimcore_studio_api_unassign_element_tag', methods: ['DELETE'])] #[IsGranted(UserPermissions::TAGS_ASSIGNMENT->value)] #[Delete( - path: self::API_PATH . '/tags/{elementType}/{id}/{tagId}', + path: self::PREFIX . '/tags/{elementType}/{id}/{tagId}', operationId: 'tag_unassign_from_element', description: 'tag_unassign_from_element_description', summary: 'tag_unassign_from_element_summary', diff --git a/src/Tag/Controller/GetController.php b/src/Tag/Controller/GetController.php index 0835f3bac..f83482b13 100644 --- a/src/Tag/Controller/GetController.php +++ b/src/Tag/Controller/GetController.php @@ -47,7 +47,7 @@ public function __construct( #[Route('/tags/{id}', name: 'pimcore_studio_api_get_tag', methods: ['GET'])] #[IsGranted(UserPermissions::TAGS_SEARCH->value)] #[Get( - path: self::API_PATH . '/tags/{id}', + path: self::PREFIX . '/tags/{id}', operationId: 'tag_get_by_id', description: 'tag_get_by_id_description', summary: 'tag_get_by_id_summary', diff --git a/src/Tag/Controller/UpdateController.php b/src/Tag/Controller/UpdateController.php index a81d8c8e5..91ce2509a 100644 --- a/src/Tag/Controller/UpdateController.php +++ b/src/Tag/Controller/UpdateController.php @@ -49,7 +49,7 @@ public function __construct( #[Route('/tags/{id}', name: 'pimcore_studio_api_update_tag', methods: ['PUT'])] #[Put( - path: self::API_PATH . '/tags/{id}', + path: self::PREFIX . '/tags/{id}', operationId: 'tag_update_by_id', description: 'tag_update_by_id_description', summary: 'tag_update_by_id_summary', diff --git a/src/Thumbnail/Controller/ImageCollectionController.php b/src/Thumbnail/Controller/ImageCollectionController.php index 42a70fb8b..9299a1e31 100644 --- a/src/Thumbnail/Controller/ImageCollectionController.php +++ b/src/Thumbnail/Controller/ImageCollectionController.php @@ -53,7 +53,7 @@ public function __construct( #[IsGranted(UserPermissions::ASSETS->value)] #[IsGranted(UserPermissions::THUMBNAILS->value)] #[Get( - path: self::API_PATH . '/thumbnails/image', + path: self::PREFIX . '/thumbnails/image', operationId: 'thumbnail_image_get_collection', description: 'thumbnail_image_get_collection_description', summary: 'thumbnail_image_get_collection_summary', diff --git a/src/Thumbnail/Controller/VideoCollectionController.php b/src/Thumbnail/Controller/VideoCollectionController.php index 9d49e7c24..f18e3005d 100644 --- a/src/Thumbnail/Controller/VideoCollectionController.php +++ b/src/Thumbnail/Controller/VideoCollectionController.php @@ -53,7 +53,7 @@ public function __construct( #[IsGranted(UserPermissions::ASSETS->value)] #[IsGranted(UserPermissions::THUMBNAILS->value)] #[Get( - path: self::API_PATH . '/thumbnails/video', + path: self::PREFIX . '/thumbnails/video', operationId: 'thumbnail_video_get_collection', description: 'thumbnail_video_get_collection_description', summary: 'thumbnail_video_get_collection_summary', diff --git a/src/Translation/Controller/TranslationController.php b/src/Translation/Controller/TranslationController.php index 1ea146dc9..4c1ba5ff0 100644 --- a/src/Translation/Controller/TranslationController.php +++ b/src/Translation/Controller/TranslationController.php @@ -53,7 +53,7 @@ public function __construct( #[Route(self::ROUTE, name: 'pimcore_studio_api_translations', methods: ['POST'])] #[IsGranted(self::VOTER_PUBLIC_STUDIO_API, 'translation')] #[POST( - path: self::API_PATH . self::ROUTE, + path: self::PREFIX . self::ROUTE, operationId: 'translation_get_collection', description: 'translation_get_collection_description', summary: 'translation_get_collection_summary', diff --git a/src/User/Controller/CloneController.php b/src/User/Controller/CloneController.php index 9650e1728..ec492424c 100644 --- a/src/User/Controller/CloneController.php +++ b/src/User/Controller/CloneController.php @@ -58,7 +58,7 @@ public function __construct( #[Route('/user/clone/{id}', name: 'pimcore_studio_api_user_clone', methods: ['POST'])] #[IsGranted(UserPermissions::USER_MANAGEMENT->value)] #[Post( - path: self::API_PATH . '/user/clone/{id}', + path: self::PREFIX . '/user/clone/{id}', operationId: 'user_clone_by_id', summary: 'user_clone_by_id_summary', tags: [Tags::User->value] diff --git a/src/User/Controller/CreateUserController.php b/src/User/Controller/CreateUserController.php index e0ec30b2b..e9a3a3729 100644 --- a/src/User/Controller/CreateUserController.php +++ b/src/User/Controller/CreateUserController.php @@ -57,7 +57,7 @@ public function __construct( #[Route('/user/', name: 'pimcore_studio_api_user_create', methods: ['POST'])] #[IsGranted(UserPermissions::USER_MANAGEMENT->value)] #[Post( - path: self::API_PATH . '/user/', + path: self::PREFIX . '/user/', operationId: 'user_create', summary: 'user_create_summary', tags: [Tags::User->value] diff --git a/src/User/Controller/CreateUserFolderController.php b/src/User/Controller/CreateUserFolderController.php index 86c9aeb95..60422991c 100644 --- a/src/User/Controller/CreateUserFolderController.php +++ b/src/User/Controller/CreateUserFolderController.php @@ -57,7 +57,7 @@ public function __construct( #[Route('/user/folder', name: 'pimcore_studio_api_user_folder_create', methods: ['POST'])] #[IsGranted(UserPermissions::USER_MANAGEMENT->value)] #[Post( - path: self::API_PATH . '/user/folder', + path: self::PREFIX . '/user/folder', operationId: 'user_folder_create', summary: 'user_folder_create_summary', tags: [Tags::User->value] diff --git a/src/User/Controller/CurrentUserController.php b/src/User/Controller/CurrentUserController.php index 131706bc6..36037425a 100644 --- a/src/User/Controller/CurrentUserController.php +++ b/src/User/Controller/CurrentUserController.php @@ -36,7 +36,7 @@ final class CurrentUserController extends AbstractApiController { #[Route('/user/current-user-information', name: 'pimcore_studio_api_current_user', methods: ['GET'])] #[Get( - path: self::API_PATH . '/user/current-user-information', + path: self::PREFIX . '/user/current-user-information', operationId: 'user_get_current_information', summary: 'user_get_current_information_summary', tags: [Tags::User->value] diff --git a/src/User/Controller/DeleteUserController.php b/src/User/Controller/DeleteUserController.php index 75393af20..b0d8c9d5c 100644 --- a/src/User/Controller/DeleteUserController.php +++ b/src/User/Controller/DeleteUserController.php @@ -54,7 +54,7 @@ public function __construct( #[Route('/user/{id}', name: 'pimcore_studio_api_user_delete', methods: ['DELETE'])] #[IsGranted(UserPermissions::USER_MANAGEMENT->value)] #[Delete( - path: self::API_PATH . '/user/{id}', + path: self::PREFIX . '/user/{id}', operationId: 'user_delete_by_id', summary: 'user_delete_by_id_summary', tags: [Tags::User->value] diff --git a/src/User/Controller/DeleteUserFolderController.php b/src/User/Controller/DeleteUserFolderController.php index 12673495f..02475bde6 100644 --- a/src/User/Controller/DeleteUserFolderController.php +++ b/src/User/Controller/DeleteUserFolderController.php @@ -54,7 +54,7 @@ public function __construct( #[Route('/user/folder/{id}', name: 'pimcore_studio_api_user_folder_delete', methods: ['DELETE'])] #[IsGranted(UserPermissions::PIMCORE_ADMIN->value)] #[Delete( - path: self::API_PATH . '/user/folder/{id}', + path: self::PREFIX . '/user/folder/{id}', operationId: 'user_folder_delete_by_id', summary: 'user_folder_delete_by_id_summary', tags: [Tags::User->value] diff --git a/src/User/Controller/GetUserController.php b/src/User/Controller/GetUserController.php index 917a9d35a..32a1c1997 100644 --- a/src/User/Controller/GetUserController.php +++ b/src/User/Controller/GetUserController.php @@ -55,7 +55,7 @@ public function __construct( #[Route('/user/{id}', name: 'pimcore_studio_api_user_get', methods: ['GET'])] #[IsGranted(UserPermissions::USER_MANAGEMENT->value)] #[Get( - path: self::API_PATH . '/user/{id}', + path: self::PREFIX . '/user/{id}', operationId: 'user_get_by_id', summary: 'user_get_by_id_summary', tags: [Tags::User->value] diff --git a/src/User/Controller/GetUserPermissionsController.php b/src/User/Controller/GetUserPermissionsController.php index 2bf194a3a..df5abc247 100644 --- a/src/User/Controller/GetUserPermissionsController.php +++ b/src/User/Controller/GetUserPermissionsController.php @@ -49,7 +49,7 @@ public function __construct( #[Route('/user/available-permissions', name: 'pimcore_studio_api_user_available_permissions', methods: ['GET'])] #[IsGranted(UserPermissions::USER_MANAGEMENT->value)] #[Get( - path: self::API_PATH . '/user/available-permissions', + path: self::PREFIX . '/user/available-permissions', operationId: 'user_get_available_permissions', summary: 'user_get_available_permissions_summary', tags: [Tags::User->value] diff --git a/src/User/Controller/GetUsersController.php b/src/User/Controller/GetUsersController.php index e6f0b4bb2..532ebe0d8 100644 --- a/src/User/Controller/GetUsersController.php +++ b/src/User/Controller/GetUsersController.php @@ -49,7 +49,7 @@ public function __construct( #[Route('/users', name: 'pimcore_studio_api_users', methods: ['GET'])] #[IsGranted(UserPermissions::USER_MANAGEMENT->value)] #[Get( - path: self::API_PATH . '/users', + path: self::PREFIX . '/users', operationId: 'user_get_collection', description: 'user_get_collection_description', summary: 'user_get_collection_summary', diff --git a/src/User/Controller/ResetPasswordController.php b/src/User/Controller/ResetPasswordController.php index 7f16426b6..6b728cc36 100644 --- a/src/User/Controller/ResetPasswordController.php +++ b/src/User/Controller/ResetPasswordController.php @@ -50,7 +50,7 @@ public function __construct( */ #[Route('/user/reset-password', name: 'pimcore_studio_api_user_reset_password', methods: ['POST'])] #[Post( - path: self::API_PATH . '/user/reset-password', + path: self::PREFIX . '/user/reset-password', operationId: 'user_reset_password', summary: 'user_reset_password_summary', tags: [Tags::User->value] diff --git a/src/User/Controller/UpdatePasswordController.php b/src/User/Controller/UpdatePasswordController.php index c7892eba3..d64350630 100644 --- a/src/User/Controller/UpdatePasswordController.php +++ b/src/User/Controller/UpdatePasswordController.php @@ -57,7 +57,7 @@ public function __construct( #[Route('/user/{id}/password', name: 'pimcore_studio_api_user_password_update', methods: ['PUT'])] #[IsGranted(UserPermissions::USER_MANAGEMENT->value)] #[Put( - path: self::API_PATH . '/user/{id}/password', + path: self::PREFIX . '/user/{id}/password', operationId: 'user_update_password_by_id', summary: 'user_update_password_by_id_summary', tags: [Tags::User->value] diff --git a/src/User/Controller/UpdateUserController.php b/src/User/Controller/UpdateUserController.php index 3a95cb481..a32914608 100644 --- a/src/User/Controller/UpdateUserController.php +++ b/src/User/Controller/UpdateUserController.php @@ -63,7 +63,7 @@ public function __construct( #[Route('/user/{id}', name: 'pimcore_studio_api_user_update', methods: ['PUT'])] #[IsGranted(UserPermissions::USER_MANAGEMENT->value)] #[Put( - path: self::API_PATH . '/user/{id}', + path: self::PREFIX . '/user/{id}', operationId: 'user_update_by_id', summary: 'user_update_by_id_summary', tags: [Tags::User->value] diff --git a/src/User/Controller/UserTreeController.php b/src/User/Controller/UserTreeController.php index 5501ceafa..764256837 100644 --- a/src/User/Controller/UserTreeController.php +++ b/src/User/Controller/UserTreeController.php @@ -53,7 +53,7 @@ public function __construct( #[Route('/users/tree', name: 'pimcore_studio_api_user_tree', methods: ['GET'])] #[IsGranted(UserPermissions::USER_MANAGEMENT->value)] #[Get( - path: self::API_PATH . '/users/tree', + path: self::PREFIX . '/users/tree', operationId: 'user_get_tree', summary: 'user_get_tree_summary', tags: [Tags::User->value] diff --git a/src/Util/Trait/StudioBackendPathTrait.php b/src/Util/Trait/StudioBackendPathTrait.php index e4c3c2d01..b5d12505b 100644 --- a/src/Util/Trait/StudioBackendPathTrait.php +++ b/src/Util/Trait/StudioBackendPathTrait.php @@ -25,6 +25,6 @@ trait StudioBackendPathTrait { private function isStudioBackendPath(string $path): bool { - return str_starts_with($path, AbstractApiController::API_PATH); + return str_starts_with($path, AbstractApiController::PREFIX); } } diff --git a/src/Version/Controller/Asset/DownloadController.php b/src/Version/Controller/Asset/DownloadController.php index c56be8d5e..0229043b1 100644 --- a/src/Version/Controller/Asset/DownloadController.php +++ b/src/Version/Controller/Asset/DownloadController.php @@ -56,7 +56,7 @@ public function __construct( #[Route('/versions/{id}/asset/download', name: 'pimcore_studio_api_download_asset_version', methods: ['GET'])] #[IsGranted(UserPermissions::ASSETS->value)] #[Get( - path: self::API_PATH . '/versions/{id}/asset/download', + path: self::PREFIX . '/versions/{id}/asset/download', operationId: 'version_asset_download_by_id', description: 'version_asset_download_by_id_description', summary: 'version_asset_download_by_id_summary', diff --git a/src/Version/Controller/Asset/ImageStreamController.php b/src/Version/Controller/Asset/ImageStreamController.php index 37a137d9c..738b07de5 100644 --- a/src/Version/Controller/Asset/ImageStreamController.php +++ b/src/Version/Controller/Asset/ImageStreamController.php @@ -57,7 +57,7 @@ public function __construct( #[Route('/versions/{id}/image/stream', name: 'pimcore_studio_api_stream_image_version', methods: ['GET'])] #[IsGranted(UserPermissions::ASSETS->value)] #[Get( - path: self::API_PATH . '/versions/{id}/image/stream', + path: self::PREFIX . '/versions/{id}/image/stream', operationId: 'version_image_stream_by_id', description: 'version_image_stream_by_id_description', summary: 'version_image_stream_by_id_summary', diff --git a/src/Version/Controller/Asset/PdfStreamController.php b/src/Version/Controller/Asset/PdfStreamController.php index 5db55712f..285f7330c 100644 --- a/src/Version/Controller/Asset/PdfStreamController.php +++ b/src/Version/Controller/Asset/PdfStreamController.php @@ -66,7 +66,7 @@ public function __construct( #[Route('/versions/{id}/pdf/stream', name: 'pimcore_studio_api_stream_pdf_version', methods: ['GET'])] #[IsGranted(UserPermissions::ASSETS->value)] #[Get( - path: self::API_PATH . '/versions/{id}/pdf/stream', + path: self::PREFIX . '/versions/{id}/pdf/stream', operationId: 'version_pdf_stream_by_id', description: 'version_pdf_stream_by_id_description', summary: 'version_pdf_stream_by_id_summary', diff --git a/src/Version/Controller/DeleteController.php b/src/Version/Controller/DeleteController.php index 5f829aa72..41cee7ce4 100644 --- a/src/Version/Controller/DeleteController.php +++ b/src/Version/Controller/DeleteController.php @@ -52,7 +52,7 @@ public function __construct( #[Route('/versions/{id}', name: 'pimcore_studio_api_delete_version', methods: ['DELETE'])] //#[IsGranted('STUDIO_API')] #[Delete( - path: self::API_PATH . '/versions/{id}', + path: self::PREFIX . '/versions/{id}', operationId: 'version_delete_by_id', description: 'version_delete_by_id_description', summary: 'version_delete_by_id_summary', diff --git a/src/Version/Controller/Element/CleanupController.php b/src/Version/Controller/Element/CleanupController.php index 824c9fad9..4a9cef094 100644 --- a/src/Version/Controller/Element/CleanupController.php +++ b/src/Version/Controller/Element/CleanupController.php @@ -56,7 +56,7 @@ public function __construct( #[Route('/versions/{elementType}/{id}', name: 'pimcore_studio_api_cleanup_versions', methods: ['DELETE'])] #[IsGranted(UserPermissions::ELEMENT_TYPE_PERMISSION->value)] #[Delete( - path: self::API_PATH . '/versions/{elementType}/{id}', + path: self::PREFIX . '/versions/{elementType}/{id}', operationId: 'version_cleanup_for_element_by_type_and_id', description: 'version_cleanup_for_element_by_type_and_id_description', summary: 'version_cleanup_for_element_by_type_and_id_summary', diff --git a/src/Version/Controller/Element/CollectionController.php b/src/Version/Controller/Element/CollectionController.php index 90700392a..e7b610b55 100644 --- a/src/Version/Controller/Element/CollectionController.php +++ b/src/Version/Controller/Element/CollectionController.php @@ -64,7 +64,7 @@ public function __construct( #[Route('/versions/{elementType}/{id}', name: 'pimcore_studio_api_versions', methods: ['GET'])] #[IsGranted(UserPermissions::ELEMENT_TYPE_PERMISSION->value)] #[Get( - path: self::API_PATH . '/versions/{elementType}/{id}', + path: self::PREFIX . '/versions/{elementType}/{id}', operationId: 'version_get_collection_for_element_by_type_and_id', description: 'version_get_collection_for_element_by_type_and_id_description', summary: 'version_get_collection_for_element_by_type_and_id_summary', diff --git a/src/Version/Controller/GetController.php b/src/Version/Controller/GetController.php index e5719e8d0..d27a474d4 100644 --- a/src/Version/Controller/GetController.php +++ b/src/Version/Controller/GetController.php @@ -53,7 +53,7 @@ public function __construct( #[Route('/versions/{id}', name: 'pimcore_studio_api_get_version', methods: ['GET'])] //#[IsGranted('STUDIO_API')] #[Get( - path: self::API_PATH . '/versions/{id}', + path: self::PREFIX . '/versions/{id}', operationId: 'version_get_by_id', description: 'version_get_by_id_description', summary: 'version_get_by_id_summary', diff --git a/src/Version/Controller/PublishController.php b/src/Version/Controller/PublishController.php index 9963ed0a3..ce4add044 100644 --- a/src/Version/Controller/PublishController.php +++ b/src/Version/Controller/PublishController.php @@ -58,7 +58,7 @@ public function __construct( #[Route('/versions/{id}', name: 'pimcore_studio_api_publish_version', methods: ['POST'])] //#[IsGranted('STUDIO_API')] #[Post( - path: self::API_PATH . '/versions/{id}', + path: self::PREFIX . '/versions/{id}', operationId: 'version_publish_by_id', description: 'version_publish_by_id_description', summary: 'version_publish_by_id_summary', diff --git a/src/Version/Controller/UpdateController.php b/src/Version/Controller/UpdateController.php index 28927b41e..901488b4a 100644 --- a/src/Version/Controller/UpdateController.php +++ b/src/Version/Controller/UpdateController.php @@ -55,7 +55,7 @@ public function __construct( */ #[Route('/versions/{id}', name: 'pimcore_studio_api_update_version', methods: ['PUT'])] #[Put( - path: self::API_PATH . '/versions/{id}', + path: self::PREFIX . '/versions/{id}', operationId: 'version_update_by_id', description: 'version_update_by_id_description', summary: 'version_update_by_id_summary', diff --git a/src/Workflow/Controller/DetailsCollectionController.php b/src/Workflow/Controller/DetailsCollectionController.php index 0f9dd10a2..1d84835c2 100644 --- a/src/Workflow/Controller/DetailsCollectionController.php +++ b/src/Workflow/Controller/DetailsCollectionController.php @@ -53,7 +53,7 @@ public function __construct( #[Route('/workflows/details', name: 'pimcore_studio_api_element_workflows_details', methods: ['GET'])] //#[IsGranted('STUDIO_API')] #[Get( - path: self::API_PATH . '/workflows/details', + path: self::PREFIX . '/workflows/details', operationId: 'workflow_get_details', description: 'workflow_get_details_description', summary: 'workflow_get_details_summary', diff --git a/src/Workflow/Controller/SubmitActionController.php b/src/Workflow/Controller/SubmitActionController.php index 4660d1a0b..e1a9cbbd4 100644 --- a/src/Workflow/Controller/SubmitActionController.php +++ b/src/Workflow/Controller/SubmitActionController.php @@ -52,7 +52,7 @@ public function __construct( )] //#[IsGranted('STUDIO_API')] #[Post( - path: self::API_PATH . '/workflows/action', + path: self::PREFIX . '/workflows/action', operationId: 'workflow_action_submit', description: 'workflow_action_submit_description', summary: 'workflow_action_submit_summary',