diff --git a/.github/workflows/php_upgrade.yaml b/.github/workflows/php_upgrade.yaml index 6f3a5e47..909de3e7 100644 --- a/.github/workflows/php_upgrade.yaml +++ b/.github/workflows/php_upgrade.yaml @@ -139,7 +139,7 @@ jobs: run: composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist --ignore-platform-reqs - name: Export specifications - run: bin/console api:openapi:export --yaml --output=public/api-spec-v1.yaml --no-interaction + run: bin/console api:openapi:export --yaml --output=public/api-spec-v2.yaml --no-interaction - name: Check for changes in specifications - run: git diff --diff-filter=ACMRT --exit-code public/api-spec-v1.yaml + run: git diff --diff-filter=ACMRT --exit-code public/api-spec-v2.yaml diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index c94964d8..b2983ce8 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -314,16 +314,16 @@ jobs: run: composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist - name: Export specifications (yaml) - run: bin/console api:openapi:export --yaml --output=public/api-spec-v1.yaml --no-interaction + run: bin/console api:openapi:export --yaml --output=public/api-spec-v2.yaml --no-interaction - name: Check for changes in specifications (yaml) - run: git diff --diff-filter=ACMRT --exit-code public/api-spec-v1.yaml + run: git diff --diff-filter=ACMRT --exit-code public/api-spec-v2.yaml - name: Export specifications (json) - run: bin/console api:openapi:export --output=public/api-spec-v1.json --no-interaction + run: bin/console api:openapi:export --output=public/api-spec-v2.json --no-interaction - name: Check for changes in specifications (json) - run: git diff --diff-filter=ACMRT --exit-code public/api-spec-v1.json + run: git diff --diff-filter=ACMRT --exit-code public/api-spec-v2.json changelog: runs-on: ubuntu-latest diff --git a/CHANGELOG.md b/CHANGELOG.md index 1eeca733..8ee32761 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +- [#198](https://github.com/os2display/display-api-service/pull/198) + - Changed route prefix to v2. - [#197](https://github.com/os2display/display-api-service/pull/197) - Fixed weight issue when assigning slides to playlist. - [#194](https://github.com/os2display/display-api-service/pull/194) diff --git a/README.md b/README.md index 162a5fd3..bf734424 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ ## OpenAPI specification -The OpenAPI specification is committed to this repo as `public/api-spec-v1.yaml` -and as `public/api-spec-v1.json`. +The OpenAPI specification is committed to this repo as `public/api-spec-v2.yaml` +and as `public/api-spec-v2.json`. A CI check will compare the current API implementation to the spec. If they are different the check will fail. @@ -18,7 +18,7 @@ If these are _breaking_ changes the API version must be changed accordingly. ## Stateless -The API is stateless except `/v1/authentication` routes. +The API is stateless except `/v2/authentication` routes. Make sure to set the `CORS_ALLOW_ORIGIN` correctly in `.env.local`. ## Rest API & Relationships @@ -27,7 +27,7 @@ To avoid embedding all relations in REST representations but still allow the cli they have to make all endpoints that have relations also has a `relationsModified` field: ```json - "@id": "/v1/screens/000XB4RQW418KK14AJ054W1FN2", + "@id": "/v2/screens/000XB4RQW418KK14AJ054W1FN2", ... "relationsModified": { "campaigns": "cf9bb7d5fd04743dd21b5e3361db7eed575258e0", @@ -155,11 +155,11 @@ docker compose exec phpfpm bin/console app:user:add ``` You can now obtain a token by sending a `POST` request to the -`/v1/authentication/token` endpoint: +`/v2/authentication/token` endpoint: ```curl curl --location --request 'POST' \ - 'http://displayapiservice.local.itkdev.dk/v1/authentication/token' \ + 'http://displayapiservice.local.itkdev.dk/v2/authentication/token' \ --header 'accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ @@ -180,7 +180,7 @@ as the api key value. Or by adding an auth header to your requests ```curl curl --location --request 'GET' \ - 'http://displayapiservice.local.itkdev.dk/v1/layouts?page=1&itemsPerPage=10' \ + 'http://displayapiservice.local.itkdev.dk/v2/layouts?page=1&itemsPerPage=10' \ --header 'accept: application/ld+json' \ --header 'Authorization: Bearer ' ``` diff --git a/composer.json b/composer.json index 07163bec..675c86b3 100644 --- a/composer.json +++ b/composer.json @@ -144,8 +144,8 @@ "bin/console --env=test doctrine:migrations:migrate --no-interaction --quiet" ], "update-api-spec": [ - "bin/console api:openapi:export --output=public/api-spec-v1.yaml --yaml --no-interaction", - "bin/console api:openapi:export --output=public/api-spec-v1.json --no-interaction" + "bin/console api:openapi:export --output=public/api-spec-v2.yaml --yaml --no-interaction", + "bin/console api:openapi:export --output=public/api-spec-v2.json --no-interaction" ] } } diff --git a/config/api_platform/feed.yaml b/config/api_platform/feed.yaml index 824666c9..2fc665a6 100644 --- a/config/api_platform/feed.yaml +++ b/config/api_platform/feed.yaml @@ -38,7 +38,7 @@ resources: openapiContext: description: Get data from a feed. summary: Get data from a feed. - operationId: get-v1-feed-id-data + operationId: get-v2-feed-id-data tags: - Feeds parameters: @@ -70,7 +70,7 @@ resources: - 'created.at.order_filter' - 'modified.at.order_filter' openapiContext: - operationId: get-v1-feeds + operationId: get-v2-feeds description: Retrieves a collection of Feed resources. summary: Retrieves a collection of Feed resources. tags: diff --git a/config/api_platform/feed_source.yaml b/config/api_platform/feed_source.yaml index d3c6a35f..2a51c034 100644 --- a/config/api_platform/feed_source.yaml +++ b/config/api_platform/feed_source.yaml @@ -42,7 +42,7 @@ resources: openapiContext: description: Get config for name from a feed source. summary: Get config for name from a feed source. - operationId: get-v1-feed-source-id-config-name + operationId: get-v2-feed-source-id-config-name tags: - FeedSources parameters: @@ -78,7 +78,7 @@ resources: - 'modified.at.order_filter' - 'feed_source.search_filter' openapiContext: - operationId: get-v1-feed-sources + operationId: get-v2-feed-sources description: Retrieves a collection of FeedSource resources. summary: Retrieves a collection of FeedSource resources. tags: diff --git a/config/api_platform/layout.yaml b/config/api_platform/layout.yaml index dc764d04..e74d0ea5 100644 --- a/config/api_platform/layout.yaml +++ b/config/api_platform/layout.yaml @@ -12,7 +12,7 @@ resources: openapiContext: description: Retrieves a screen layout resource. summary: Retrieve a screen layout resource. - operationId: get-v1-layouts-id + operationId: get-v2-layouts-id tags: - Layouts parameters: @@ -38,7 +38,7 @@ resources: summary: Retrieves a collection of layouts resources. tags: - Layouts - operationId: get-v1-layouts + operationId: get-v2-layouts parameters: - schema: type: integer diff --git a/config/api_platform/media.yaml b/config/api_platform/media.yaml index c6231b6d..0e96d3a4 100644 --- a/config/api_platform/media.yaml +++ b/config/api_platform/media.yaml @@ -13,7 +13,7 @@ resources: openapiContext: description: Retrieves a Media resource. summary: Retrieve a Media resource. - operationId: getV1MediaById + operationId: getv2MediaById tags: - Media parameters: @@ -36,7 +36,7 @@ resources: openapiContext: description: Delete a Media resource. summary: Delete a Media resource. - operationId: delete-v1-media-id + operationId: delete-v2-media-id tags: - Media parameters: @@ -60,7 +60,7 @@ resources: summary: Retrieves a collection of Media resources. tags: - Media - operationId: get-v1-medias + operationId: get-v2-medias parameters: - schema: type: integer diff --git a/config/api_platform/playlist.yaml b/config/api_platform/playlist.yaml index 19f6f9b1..cdc588e3 100644 --- a/config/api_platform/playlist.yaml +++ b/config/api_platform/playlist.yaml @@ -13,7 +13,7 @@ resources: normalizationContext: jsonld_embed_context: true openapiContext: - operationId: get-v1-playlist-id + operationId: get-v2-playlist-id description: Retrieve a Playlist resource. summary: Retrieves a Playlist resource. tags: @@ -38,7 +38,7 @@ resources: openapiContext: description: Update a Playlist resource. summary: Update a Playlist resource. - operationId: put-v1-playlist-id + operationId: put-v2-playlist-id tags: - Playlists parameters: @@ -54,7 +54,7 @@ resources: openapiContext: description: Delete a Playlist resource. summary: Delete a Playlist resource. - operationId: delete-v1-playlist-id + operationId: delete-v2-playlist-id tags: - Playlists parameters: @@ -77,7 +77,7 @@ resources: - 'modified.at.order_filter' - 'App\Filter\SharedWithMe' openapiContext: - operationId: get-v1-playlists + operationId: get-v2-playlists description: Retrieves a collection of Playlist resources. summary: Retrieve a collection of Playlist resources. tags: @@ -103,7 +103,7 @@ resources: normalizationContext: jsonld_embed_context: true openapiContext: - operationId: create-v1-playlist + operationId: create-v2-playlist description: Creates a Playlist resource. summary: Creates a Playlist resource. tags: diff --git a/config/api_platform/playlist_screen_region.yaml b/config/api_platform/playlist_screen_region.yaml index 87655f17..916d5d90 100644 --- a/config/api_platform/playlist_screen_region.yaml +++ b/config/api_platform/playlist_screen_region.yaml @@ -109,7 +109,7 @@ resources: filters: ['App\Filter\SharedWithMe'] uriTemplate: '/screens/{id}/regions/{regionId}/playlists' openapiContext: - operationId: get-v1-playlist-screen-regions + operationId: get-v2-playlist-screen-regions description: Retrieve a Playlist resources base on screen regions. summary: Retrieves a Playlist resources base on screen region. tags: diff --git a/config/api_platform/playlist_slide.yaml b/config/api_platform/playlist_slide.yaml index fb4bd7c6..24c91b6e 100644 --- a/config/api_platform/playlist_slide.yaml +++ b/config/api_platform/playlist_slide.yaml @@ -21,7 +21,7 @@ resources: openapiContext: description: Delete a slide from a playlist. summary: Delete a slide from a playlist. - operationId: delete-v1-playlist-slide-id + operationId: delete-v2-playlist-slide-id tags: - Playlists parameters: @@ -49,7 +49,7 @@ resources: openapiContext: description: Update the collection of slide on a playlist. summary: Update the collection of slide on a playlist. - operationId: put-v1-playlist-slide-id + operationId: put-v2-playlist-slide-id tags: - Playlists requestBody: @@ -102,7 +102,7 @@ resources: openapiContext: description: Get the collection of playlist connected to a slide. summary: Get the collection of playlist connected to a slide. - operationId: put-v1-slide-playlist-id + operationId: put-v2-slide-playlist-id tags: - Playlists parameters: @@ -152,7 +152,7 @@ resources: openapiContext: description: Retrieves collection of playlist resources. summary: Retrieves collection of playlistresources. - operationId: get-v1-slide-playlist-id + operationId: get-v2-slide-playlist-id tags: - Playlists parameters: @@ -194,7 +194,7 @@ resources: openapiContext: description: Retrieves collection of weighted slide resources. summary: Retrieves collection of weighted slide resources. - operationId: get-v1-playlist-slide-id + operationId: get-v2-playlist-slide-id tags: - Playlists parameters: diff --git a/config/api_platform/screen.yaml b/config/api_platform/screen.yaml index 1f946242..38521e43 100644 --- a/config/api_platform/screen.yaml +++ b/config/api_platform/screen.yaml @@ -38,7 +38,7 @@ resources: openapiContext: description: Update a Screen resource. summary: Update a Screen resource. - operationId: put-v1-screen-id + operationId: put-v2-screen-id tags: - Screens parameters: @@ -55,7 +55,7 @@ resources: openapiContext: description: Delete a Screen resource. summary: Delete a Screen resource. - operationId: delete-v1-screen-id + operationId: delete-v2-screen-id tags: - Screens parameters: @@ -75,7 +75,7 @@ resources: - 'created.at.order_filter' - 'modified.at.order_filter' openapiContext: - operationId: get-v1-screens + operationId: get-v2-screens description: Retrieves a collection of Screen resources. summary: Retrieves a collection of Screen resources. tags: @@ -108,7 +108,7 @@ resources: normalizationContext: jsonld_embed_context: true openapiContext: - operationId: create-v1-screens + operationId: create-v2-screens description: Creates a Screen resource. summary: Creates a Screen resource. tags: diff --git a/config/api_platform/screen_campaign.yaml b/config/api_platform/screen_campaign.yaml index 7adb855a..00209f07 100644 --- a/config/api_platform/screen_campaign.yaml +++ b/config/api_platform/screen_campaign.yaml @@ -20,7 +20,7 @@ resources: openapiContext: description: Delete a campaign from a screen. summary: Delete a campaign from a screen. - operationId: delete-v1-screen-campaign-id + operationId: delete-v2-screen-campaign-id tags: - Screens parameters: @@ -49,7 +49,7 @@ resources: openapiContext: description: Update the collection of screens on a playlist. summary: Update the collection of screens on a playlist. - operationId: put-v1-screen-campaign-id + operationId: put-v2-screen-campaign-id tags: - Screens requestBody: @@ -99,7 +99,7 @@ resources: openapiContext: description: Retrieves collection of campaign resources. summary: Retrieves collection of campaign resources. - operationId: get-v1-screen-campaign-id + operationId: get-v2-screen-campaign-id tags: - Screens parameters: @@ -146,7 +146,7 @@ resources: openapiContext: description: Get screens connected to a campaign. summary: Get screens connected to a campaign. - operationId: get-v1-campaign-id-screen + operationId: get-v2-campaign-id-screen tags: - Playlists parameters: diff --git a/config/api_platform/screen_groups.yaml b/config/api_platform/screen_groups.yaml index c95c2a1d..d57a1a1d 100644 --- a/config/api_platform/screen_groups.yaml +++ b/config/api_platform/screen_groups.yaml @@ -15,7 +15,7 @@ resources: openapiContext: description: Retrieves a Screen group resource. summary: Retrieve a Screen group resource. - operationId: get-v1-screen-groups-id + operationId: get-v2-screen-groups-id tags: - ScreenGroups parameters: @@ -40,7 +40,7 @@ resources: openapiContext: description: Update a Screen group resource. summary: Update a Screen group resource. - operationId: put-v1-screen-groups-id + operationId: put-v2-screen-groups-id tags: - ScreenGroups parameters: @@ -58,7 +58,7 @@ resources: openapiContext: description: Delete a Screen group resource. summary: Delete a Screen group resource. - operationId: delete-v1-screen-groups-id + operationId: delete-v2-screen-groups-id tags: - ScreenGroups parameters: @@ -82,7 +82,7 @@ resources: openapiContext: description: Update the collection of ScreenGroups on a Screen. summary: Update the collection of ScreenGroups on a Screen. - operationId: put-v1-screen-groups-screen + operationId: put-v2-screen-groups-screen tags: - Screens parameters: @@ -119,7 +119,7 @@ resources: openapiContext: description: Delete a screen groups from a screen. summary: Delete a screen groups from a screen - operationId: delete-v1-screen-group-screen-id + operationId: delete-v2-screen-group-screen-id tags: - Screens parameters: @@ -150,7 +150,7 @@ resources: summary: Retrieves a collection of Screen group resources. tags: - ScreenGroups - operationId: get-v1-screen-groups + operationId: get-v2-screen-groups parameters: - schema: type: integer @@ -182,7 +182,7 @@ resources: uriTemplate: '/screens/{id}/screen-groups' provider: App\State\ScreenGroupsScreensProvider openapiContext: - operationId: get-v1-screen-id-screen-groups + operationId: get-v2-screen-id-screen-groups description: Retrieve screen-groups from screen id. summary: Retrieve screen-groups from screen id. tags: @@ -215,7 +215,7 @@ resources: openapiContext: description: Create Screen group resources. summary: Create Screen group resources. - operationId: post-v1-screen-groups + operationId: post-v2-screen-groups tags: - ScreenGroups @@ -229,7 +229,7 @@ resources: openapiContext: description: Get screens in screen group. summary: Gets screens in screen group. - operationId: get-v1-screen-id-screen-group + operationId: get-v2-screen-id-screen-group tags: - ScreenGroups parameters: diff --git a/config/api_platform/screen_groups_campaign.yaml b/config/api_platform/screen_groups_campaign.yaml index 99bb05b0..baa9af05 100644 --- a/config/api_platform/screen_groups_campaign.yaml +++ b/config/api_platform/screen_groups_campaign.yaml @@ -23,7 +23,7 @@ resources: openapiContext: description: Delete a campaign from a screen group. summary: Delete a campaign from a screen group. - operationId: delete-v1-screen-groups-campaign-id + operationId: delete-v2-screen-groups-campaign-id tags: - ScreenGroups parameters: @@ -52,7 +52,7 @@ resources: openapiContext: description: Update the collection of screen groups on a playlist. summary: Update the collection of screen groups on a playlist. - operationId: put-v1-screen-groups-campaign-id + operationId: put-v2-screen-groups-campaign-id tags: - ScreenGroups requestBody: @@ -101,7 +101,7 @@ resources: openapiContext: description: Retrieves collection of campaign resources connected to a screen group. summary: Retrieves collection of campaign resources connected to a screen group. - operationId: get-v1-screen-groups-campaign-id + operationId: get-v2-screen-groups-campaign-id tags: - ScreenGroups parameters: @@ -145,7 +145,7 @@ resources: openapiContext: description: Get Screen group resources on campaign. summary: Get Screen group resources on campaign. - operationId: get-v1-campaign-id-screen-group + operationId: get-v2-campaign-id-screen-group tags: - Playlists parameters: diff --git a/config/api_platform/slide.yaml b/config/api_platform/slide.yaml index 5a78b85a..602ae7e4 100644 --- a/config/api_platform/slide.yaml +++ b/config/api_platform/slide.yaml @@ -11,7 +11,7 @@ resources: operations: ApiPlatform\Metadata\Get: &get openapiContext: - operationId: get-v1-slide-id + operationId: get-v2-slide-id description: Retrieves a Slide resource. summary: Retrieve a Slide resource. tags: @@ -36,7 +36,7 @@ resources: openapiContext: description: Update a Slide resource. summary: Update a Slide resource. - operationId: put-v1-slide-id + operationId: put-v2-slide-id tags: - Slides parameters: @@ -52,7 +52,7 @@ resources: openapiContext: description: Delete a Slide resource. summary: Delete a Slide resource. - operationId: delete-v1-slide-id + operationId: delete-v2-slide-id tags: - Slides parameters: @@ -73,7 +73,7 @@ resources: - 'created.at.order_filter' - 'modified.at.order_filter' openapiContext: - operationId: get-v1-slides + operationId: get-v2-slides description: Retrieves a collection of Slide resources. summary: Retrieves a collection of Slide resources. tags: @@ -102,7 +102,7 @@ resources: ApiPlatform\Metadata\Post: openapiContext: - operationId: create-v1-slides + operationId: create-v2-slides description: Creates a Slide resource. summary: Creates a Slide resource. tags: diff --git a/config/api_platform/template.yaml b/config/api_platform/template.yaml index e8e1eda8..01895870 100644 --- a/config/api_platform/template.yaml +++ b/config/api_platform/template.yaml @@ -11,7 +11,7 @@ resources: openapiContext: description: Retrieves a Template resource. summary: Retrieve a Template resource. - operationId: get-v1-template-id + operationId: get-v2-template-id tags: - Templates parameters: @@ -37,7 +37,7 @@ resources: - 'created.at.order_filter' - 'modified.at.order_filter' openapiContext: - operationId: get-v1-templates + operationId: get-v2-templates description: Retrieve a collection of Template resources. summary: Retrieve a collection of Template resources. tags: diff --git a/config/api_platform/tenant.yaml b/config/api_platform/tenant.yaml index 23726855..b939ec0a 100644 --- a/config/api_platform/tenant.yaml +++ b/config/api_platform/tenant.yaml @@ -9,7 +9,7 @@ resources: openapiContext: description: Retrieves a tenant resource. summary: Retrieve a tenant resource. - operationId: get-v1-tenant-id + operationId: get-v2-tenant-id tags: - Tenants parameters: @@ -31,7 +31,7 @@ resources: ApiPlatform\Metadata\GetCollection: filters: ['entity.search_filter', 'entity.blameable_filter'] openapiContext: - operationId: get-v1-tenants + operationId: get-v2-tenants description: Retrieves a collection of tenant resources. summary: Retrieves a collection of tenant resources. tags: diff --git a/config/api_platform/theme.yaml b/config/api_platform/theme.yaml index 719fe765..40e3dd3e 100644 --- a/config/api_platform/theme.yaml +++ b/config/api_platform/theme.yaml @@ -14,7 +14,7 @@ resources: openapiContext: description: Retrieves a Theme resource. summary: Retrieve a Theme resource. - operationId: get-v1-theme-id + operationId: get-v2-theme-id tags: - Themes parameters: @@ -43,7 +43,7 @@ resources: - 'created.at.order_filter' - 'modified.at.order_filter' openapiContext: - operationId: get-v1-themes + operationId: get-v2-themes description: Retrieve a collection of Theme resources. summary: Retrieve a collection of Theme resources. tags: @@ -75,7 +75,7 @@ resources: openapiContext: description: Update a Theme resource. summary: Update a Theme resource. - operationId: put-v1-theme-id + operationId: put-v2-theme-id tags: - Themes parameters: @@ -92,7 +92,7 @@ resources: openapiContext: description: Delete a Theme resource. summary: Delete a Theme resource. - operationId: delete-v1-theme-id + operationId: delete-v2-theme-id tags: - Themes parameters: @@ -107,7 +107,7 @@ resources: ApiPlatform\Metadata\Post: security: 'is_granted("ROLE_ADMIN")' openapiContext: - operationId: create-v1-themes + operationId: create-v2-themes description: Creates a Theme resource. summary: Creates a Theme resource. tags: diff --git a/config/api_platform/user-activation-code.yaml b/config/api_platform/user-activation-code.yaml index cb9bfe23..b6331d72 100644 --- a/config/api_platform/user-activation-code.yaml +++ b/config/api_platform/user-activation-code.yaml @@ -21,7 +21,7 @@ resources: openapiContext: description: Create user activation code summary: Create user activation code. - operationId: post-v1-create-user-activation-code + operationId: post-v2-create-user-activation-code tags: - UserActivationCode ApiPlatform\Metadata\GetCollection: @@ -37,7 +37,7 @@ resources: openapiContext: description: Refresh user activation code. summary: Refresh user activation code. - operationId: post-v1-refresh-user-activation-code + operationId: post-v2-refresh-user-activation-code tags: - UserActivationCode _api_/user-activation-codes/activate: @@ -50,7 +50,7 @@ resources: openapiContext: description: Use user activation code. summary: Use user activation code. - operationId: post-v1-activate-user-activation-code + operationId: post-v2-activate-user-activation-code tags: - UserActivationCode diff --git a/config/api_platform/user.yaml b/config/api_platform/user.yaml index 795c234c..5a63758b 100644 --- a/config/api_platform/user.yaml +++ b/config/api_platform/user.yaml @@ -12,7 +12,7 @@ resources: openapiContext: description: Retrieves User resource. summary: Retrieve User resource. - operationId: get-v1-user-id + operationId: get-v2-user-id parameters: - schema: type: string @@ -35,7 +35,7 @@ resources: openapiContext: description: Update User resource. summary: Update User resource. - operationId: put-v1-user-id + operationId: put-v2-user-id parameters: - schema: type: string @@ -51,7 +51,7 @@ resources: openapiContext: description: Delete an User resource. summary: Delete an User resource. - operationId: delete-v1-user-id + operationId: delete-v2-user-id parameters: - schema: type: string @@ -70,7 +70,7 @@ resources: openapiContext: description: Remove a User resource from the current tenant. summary: Remove a User resource from the current tenant. - operationId: post-v1-remove-user-from-tenant + operationId: post-v2-remove-user-from-tenant parameters: - schema: type: string @@ -92,7 +92,7 @@ resources: - 'created.at.order_filter' - 'updated.at.order_filter' openapiContext: - operationId: get-v1-users + operationId: get-v2-users description: Retrieve a collection of User resources. summary: Retrieve a collection of User resources. parameters: @@ -123,7 +123,7 @@ resources: openapiContext: description: Create a User resource. summary: Create a User resource. - operationId: post-v1-user + operationId: post-v2-user parameters: - schema: type: string diff --git a/config/packages/api_platform.yaml b/config/packages/api_platform.yaml index 57d632d3..3455a12d 100644 --- a/config/packages/api_platform.yaml +++ b/config/packages/api_platform.yaml @@ -5,7 +5,7 @@ api_platform: enable_re_doc: false defaults: - route_prefix: 'v1' + route_prefix: 'v2' pagination_enabled: true pagination_items_per_page: 10 pagination_maximum_items_per_page: 30 diff --git a/config/packages/nelmio_cors.yaml b/config/packages/nelmio_cors.yaml index 969837cf..2ae9f080 100644 --- a/config/packages/nelmio_cors.yaml +++ b/config/packages/nelmio_cors.yaml @@ -8,6 +8,6 @@ nelmio_cors: expose_headers: ['Link'] max_age: 3600 paths: - '^/v1/authentication/': + '^/v2/authentication/': allow_credentials: true '^/': null diff --git a/config/packages/security.yaml b/config/packages/security.yaml index 33b002b5..9f55876f 100644 --- a/config/packages/security.yaml +++ b/config/packages/security.yaml @@ -28,34 +28,34 @@ security: pattern: ^/(_(profiler|wdt)|css|images|js)/ security: false login_screen: - pattern: ^/v1/authentication/screen + pattern: ^/v2/authentication/screen security: false login_oidc: - pattern: ^/v1/authentication/oidc + pattern: ^/v2/authentication/oidc security: false api_token_refresh: - pattern: ^/v1/authentication/token/refresh + pattern: ^/v2/authentication/token/refresh stateless: true refresh_jwt: provider: user_provider login: - pattern: ^/v1/authentication/token + pattern: ^/v2/authentication/token stateless: true provider: user_provider json_login: - check_path: /v1/authentication/token + check_path: /v2/authentication/token username_path: providerId password_path: password success_handler: Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface failure_handler: Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface activation_code: - pattern: ^/v1/user-activation-codes/activate + pattern: ^/v2/user-activation-codes/activate stateless: true provider: user_provider jwt: authenticator: app.external_user_authenticator api: - pattern: ^/v1/ + pattern: ^/v2/ stateless: true provider: user_provider jwt: @@ -70,9 +70,9 @@ security: # Easy way to control access for large sections of your site # Note: Only the *first* access control that matches will be used access_control: - - { path: ^/v1/authentication, roles: PUBLIC_ACCESS } - - { path: ^/v1/docs, roles: PUBLIC_ACCESS } # Allows accessing the Swagger UI - - { path: ^/v1, roles: IS_AUTHENTICATED_FULLY } + - { path: ^/v2/authentication, roles: PUBLIC_ACCESS } + - { path: ^/v2/docs, roles: PUBLIC_ACCESS } # Allows accessing the Swagger UI + - { path: ^/v2, roles: IS_AUTHENTICATED_FULLY } role_hierarchy: ROLE_SCREEN: ROLE_USER diff --git a/config/routes.yaml b/config/routes.yaml index 34f63f9d..014d6831 100644 --- a/config/routes.yaml +++ b/config/routes.yaml @@ -3,24 +3,24 @@ # controller: App\Controller\DefaultController::index gesdinet_jwt_refresh_token: - path: /v1/authentication/token/refresh + path: /v2/authentication/token/refresh # api/config/routes.yaml authentication-token: - path: /v1/authentication/token + path: /v2/authentication/token methods: ['POST'] authentication-screen: - path: /v1/authentication/screen + path: /v2/authentication/screen methods: [ 'POST' ] controller: 'App\Controller\AuthScreenController' authentication-bind-screen: - path: /v1/screens/{id}/bind + path: /v2/screens/{id}/bind methods: [ 'POST' ] controller: 'App\Controller\AuthScreenBindController' authentication-unbind-screen: - path: /v1/screens/{id}/unbind + path: /v2/screens/{id}/unbind methods: [ 'POST' ] controller: 'App\Controller\AuthScreenUnbindController' diff --git a/public/api-spec-v1.json b/public/api-spec-v2.json old mode 100755 new mode 100644 similarity index 98% rename from public/api-spec-v1.json rename to public/api-spec-v2.json index fdfe5590..6b186542 --- a/public/api-spec-v1.json +++ b/public/api-spec-v2.json @@ -15,7 +15,7 @@ } ], "paths": { - "/v1/authentication/oidc/token": { + "/v2/authentication/oidc/token": { "get": { "operationId": "getOidcAuthTokenItem", "tags": [ @@ -59,7 +59,7 @@ }, "parameters": [] }, - "/v1/authentication/oidc/urls": { + "/v2/authentication/oidc/urls": { "get": { "operationId": "getOidcAuthUrlsItem", "tags": [ @@ -93,7 +93,7 @@ }, "parameters": [] }, - "/v1/authentication/screen": { + "/v2/authentication/screen": { "post": { "operationId": "postLoginInfoScreen", "tags": [ @@ -126,7 +126,7 @@ }, "parameters": [] }, - "/v1/authentication/token": { + "/v2/authentication/token": { "post": { "operationId": "login_check_post", "tags": [ @@ -184,7 +184,7 @@ }, "parameters": [] }, - "/v1/authentication/token/refresh": { + "/v2/authentication/token/refresh": { "post": { "operationId": "postRefreshTokenItem", "tags": [ @@ -217,9 +217,9 @@ }, "parameters": [] }, - "/v1/campaigns/{id}/screen-groups": { + "/v2/campaigns/{id}/screen-groups": { "get": { - "operationId": "get-v1-campaign-id-screen-group", + "operationId": "get-v2-campaign-id-screen-group", "tags": [ "Playlists" ], @@ -395,9 +395,9 @@ }, "parameters": [] }, - "/v1/campaigns/{id}/screens": { + "/v2/campaigns/{id}/screens": { "get": { - "operationId": "get-v1-campaign-id-screen", + "operationId": "get-v2-campaign-id-screen", "tags": [ "Playlists" ], @@ -573,9 +573,9 @@ }, "parameters": [] }, - "/v1/feed-sources": { + "/v2/feed-sources": { "get": { - "operationId": "get-v1-feed-sources", + "operationId": "get-v2-feed-sources", "tags": [ "FeedSources" ], @@ -823,7 +823,7 @@ }, "parameters": [] }, - "/v1/feed-sources/{id}": { + "/v2/feed-sources/{id}": { "get": { "operationId": "get-feed-source-id", "tags": [ @@ -864,9 +864,9 @@ }, "parameters": [] }, - "/v1/feed_sources/{id}/config/{name}": { + "/v2/feed_sources/{id}/config/{name}": { "get": { - "operationId": "get-v1-feed-source-id-config-name", + "operationId": "get-v2-feed-source-id-config-name", "tags": [ "FeedSources" ], @@ -929,9 +929,9 @@ }, "parameters": [] }, - "/v1/feeds": { + "/v2/feeds": { "get": { - "operationId": "get-v1-feeds", + "operationId": "get-v2-feeds", "tags": [ "Feeds" ], @@ -1084,7 +1084,7 @@ }, "parameters": [] }, - "/v1/feeds/{id}": { + "/v2/feeds/{id}": { "get": { "operationId": "get-feeds-id", "tags": [ @@ -1125,9 +1125,9 @@ }, "parameters": [] }, - "/v1/feeds/{id}/data": { + "/v2/feeds/{id}/data": { "get": { - "operationId": "get-v1-feed-id-data", + "operationId": "get-v2-feed-id-data", "tags": [ "Feeds" ], @@ -1183,9 +1183,9 @@ }, "parameters": [] }, - "/v1/layouts": { + "/v2/layouts": { "get": { - "operationId": "get-v1-layouts", + "operationId": "get-v2-layouts", "tags": [ "Layouts" ], @@ -1242,9 +1242,9 @@ }, "parameters": [] }, - "/v1/layouts/{id}": { + "/v2/layouts/{id}": { "get": { - "operationId": "get-v1-layouts-id", + "operationId": "get-v2-layouts-id", "tags": [ "Layouts" ], @@ -1283,9 +1283,9 @@ }, "parameters": [] }, - "/v1/media": { + "/v2/media": { "get": { - "operationId": "get-v1-medias", + "operationId": "get-v2-medias", "tags": [ "Media" ], @@ -1573,9 +1573,9 @@ }, "parameters": [] }, - "/v1/media/{id}": { + "/v2/media/{id}": { "get": { - "operationId": "getV1MediaById", + "operationId": "getv2MediaById", "tags": [ "Media" ], @@ -1613,7 +1613,7 @@ "deprecated": false }, "delete": { - "operationId": "delete-v1-media-id", + "operationId": "delete-v2-media-id", "tags": [ "Media" ], @@ -1649,9 +1649,9 @@ }, "parameters": [] }, - "/v1/playlists": { + "/v2/playlists": { "get": { - "operationId": "get-v1-playlists", + "operationId": "get-v2-playlists", "tags": [ "Playlists" ], @@ -1911,7 +1911,7 @@ "deprecated": false }, "post": { - "operationId": "create-v1-playlist", + "operationId": "create-v2-playlist", "tags": [ "Playlists" ], @@ -1972,9 +1972,9 @@ }, "parameters": [] }, - "/v1/playlists/{id}": { + "/v2/playlists/{id}": { "get": { - "operationId": "get-v1-playlist-id", + "operationId": "get-v2-playlist-id", "tags": [ "Playlists" ], @@ -2012,7 +2012,7 @@ "deprecated": false }, "put": { - "operationId": "put-v1-playlist-id", + "operationId": "put-v2-playlist-id", "tags": [ "Playlists" ], @@ -2092,7 +2092,7 @@ "deprecated": false }, "delete": { - "operationId": "delete-v1-playlist-id", + "operationId": "delete-v2-playlist-id", "tags": [ "Playlists" ], @@ -2128,9 +2128,9 @@ }, "parameters": [] }, - "/v1/playlists/{id}/slides": { + "/v2/playlists/{id}/slides": { "get": { - "operationId": "get-v1-playlist-slide-id", + "operationId": "get-v2-playlist-slide-id", "tags": [ "Playlists" ], @@ -2214,7 +2214,7 @@ "deprecated": false }, "put": { - "operationId": "put-v1-playlist-slide-id", + "operationId": "put-v2-playlist-slide-id", "tags": [ "Playlists" ], @@ -2291,9 +2291,9 @@ }, "parameters": [] }, - "/v1/playlists/{id}/slides/{slideId}": { + "/v2/playlists/{id}/slides/{slideId}": { "delete": { - "operationId": "delete-v1-playlist-slide-id", + "operationId": "delete-v2-playlist-slide-id", "tags": [ "Playlists" ], @@ -2345,9 +2345,9 @@ }, "parameters": [] }, - "/v1/screen-groups": { + "/v2/screen-groups": { "get": { - "operationId": "get-v1-screen-groups", + "operationId": "get-v2-screen-groups", "tags": [ "ScreenGroups" ], @@ -2545,7 +2545,7 @@ "deprecated": false }, "post": { - "operationId": "post-v1-screen-groups", + "operationId": "post-v2-screen-groups", "tags": [ "ScreenGroups" ], @@ -2606,7 +2606,7 @@ }, "parameters": [] }, - "/v1/screen-groups-campaigns/{id}": { + "/v2/screen-groups-campaigns/{id}": { "get": { "operationId": "getScreenGroupCampaignItem", "tags": [ @@ -2659,9 +2659,9 @@ }, "parameters": [] }, - "/v1/screen-groups/{id}": { + "/v2/screen-groups/{id}": { "get": { - "operationId": "get-v1-screen-groups-id", + "operationId": "get-v2-screen-groups-id", "tags": [ "ScreenGroups" ], @@ -2699,7 +2699,7 @@ "deprecated": false }, "put": { - "operationId": "put-v1-screen-groups-id", + "operationId": "put-v2-screen-groups-id", "tags": [ "ScreenGroups" ], @@ -2779,7 +2779,7 @@ "deprecated": false }, "delete": { - "operationId": "delete-v1-screen-groups-id", + "operationId": "delete-v2-screen-groups-id", "tags": [ "ScreenGroups" ], @@ -2815,9 +2815,9 @@ }, "parameters": [] }, - "/v1/screen-groups/{id}/campaigns": { + "/v2/screen-groups/{id}/campaigns": { "get": { - "operationId": "get-v1-screen-groups-campaign-id", + "operationId": "get-v2-screen-groups-campaign-id", "tags": [ "ScreenGroups" ], @@ -2901,7 +2901,7 @@ "deprecated": false }, "put": { - "operationId": "put-v1-screen-groups-campaign-id", + "operationId": "put-v2-screen-groups-campaign-id", "tags": [ "ScreenGroups" ], @@ -2972,9 +2972,9 @@ }, "parameters": [] }, - "/v1/screen-groups/{id}/campaigns/{campaignId}": { + "/v2/screen-groups/{id}/campaigns/{campaignId}": { "delete": { - "operationId": "delete-v1-screen-groups-campaign-id", + "operationId": "delete-v2-screen-groups-campaign-id", "tags": [ "ScreenGroups" ], @@ -3026,9 +3026,9 @@ }, "parameters": [] }, - "/v1/screen-groups/{id}/screens": { + "/v2/screen-groups/{id}/screens": { "get": { - "operationId": "get-v1-screen-id-screen-group", + "operationId": "get-v2-screen-id-screen-group", "tags": [ "ScreenGroups" ], @@ -3204,9 +3204,9 @@ }, "parameters": [] }, - "/v1/screens": { + "/v2/screens": { "get": { - "operationId": "get-v1-screens", + "operationId": "get-v2-screens", "tags": [ "Screens" ], @@ -3408,7 +3408,7 @@ "deprecated": false }, "post": { - "operationId": "create-v1-screens", + "operationId": "create-v2-screens", "tags": [ "Screens" ], @@ -3469,7 +3469,7 @@ }, "parameters": [] }, - "/v1/screens/{id}": { + "/v2/screens/{id}": { "get": { "operationId": "get-screens-id", "tags": [ @@ -3509,7 +3509,7 @@ "deprecated": false }, "put": { - "operationId": "put-v1-screen-id", + "operationId": "put-v2-screen-id", "tags": [ "Screens" ], @@ -3589,7 +3589,7 @@ "deprecated": false }, "delete": { - "operationId": "delete-v1-screen-id", + "operationId": "delete-v2-screen-id", "tags": [ "Screens" ], @@ -3625,7 +3625,7 @@ }, "parameters": [] }, - "/v1/screens/{id}/bind": { + "/v2/screens/{id}/bind": { "post": { "operationId": "postScreenBindKey", "tags": [ @@ -3667,9 +3667,9 @@ }, "parameters": [] }, - "/v1/screens/{id}/campaigns": { + "/v2/screens/{id}/campaigns": { "get": { - "operationId": "get-v1-screen-campaign-id", + "operationId": "get-v2-screen-campaign-id", "tags": [ "Screens" ], @@ -3753,7 +3753,7 @@ "deprecated": false }, "put": { - "operationId": "put-v1-screen-campaign-id", + "operationId": "put-v2-screen-campaign-id", "tags": [ "Screens" ], @@ -3824,9 +3824,9 @@ }, "parameters": [] }, - "/v1/screens/{id}/campaigns/{campaignId}": { + "/v2/screens/{id}/campaigns/{campaignId}": { "delete": { - "operationId": "delete-v1-screen-campaign-id", + "operationId": "delete-v2-screen-campaign-id", "tags": [ "Screens" ], @@ -3878,9 +3878,9 @@ }, "parameters": [] }, - "/v1/screens/{id}/regions/{regionId}/playlists": { + "/v2/screens/{id}/regions/{regionId}/playlists": { "get": { - "operationId": "get-v1-playlist-screen-regions", + "operationId": "get-v2-playlist-screen-regions", "tags": [ "Screens" ], @@ -4165,7 +4165,7 @@ }, "parameters": [] }, - "/v1/screens/{id}/regions/{regionId}/playlists/{playlistId}": { + "/v2/screens/{id}/regions/{regionId}/playlists/{playlistId}": { "delete": { "operationId": "deletePlaylistScreenRegionItem", "tags": [ @@ -4235,9 +4235,9 @@ }, "parameters": [] }, - "/v1/screens/{id}/screen-groups": { + "/v2/screens/{id}/screen-groups": { "get": { - "operationId": "get-v1-screen-id-screen-groups", + "operationId": "get-v2-screen-id-screen-groups", "tags": [ "Screens" ], @@ -4448,7 +4448,7 @@ "deprecated": false }, "put": { - "operationId": "put-v1-screen-groups-screen", + "operationId": "put-v2-screen-groups-screen", "tags": [ "Screens" ], @@ -4500,9 +4500,9 @@ }, "parameters": [] }, - "/v1/screens/{id}/screen-groups/{screenGroupId}": { + "/v2/screens/{id}/screen-groups/{screenGroupId}": { "delete": { - "operationId": "delete-v1-screen-group-screen-id", + "operationId": "delete-v2-screen-group-screen-id", "tags": [ "Screens" ], @@ -4554,7 +4554,7 @@ }, "parameters": [] }, - "/v1/screens/{id}/unbind": { + "/v2/screens/{id}/unbind": { "post": { "operationId": "postScreenUnbind", "tags": [ @@ -4590,9 +4590,9 @@ }, "parameters": [] }, - "/v1/slides": { + "/v2/slides": { "get": { - "operationId": "get-v1-slides", + "operationId": "get-v2-slides", "tags": [ "Slides" ], @@ -4822,7 +4822,7 @@ "deprecated": false }, "post": { - "operationId": "create-v1-slides", + "operationId": "create-v2-slides", "tags": [ "Slides" ], @@ -4883,9 +4883,9 @@ }, "parameters": [] }, - "/v1/slides/{id}": { + "/v2/slides/{id}": { "get": { - "operationId": "get-v1-slide-id", + "operationId": "get-v2-slide-id", "tags": [ "Slides" ], @@ -4923,7 +4923,7 @@ "deprecated": false }, "put": { - "operationId": "put-v1-slide-id", + "operationId": "put-v2-slide-id", "tags": [ "Slides" ], @@ -5003,7 +5003,7 @@ "deprecated": false }, "delete": { - "operationId": "delete-v1-slide-id", + "operationId": "delete-v2-slide-id", "tags": [ "Slides" ], @@ -5039,9 +5039,9 @@ }, "parameters": [] }, - "/v1/slides/{id}/playlists": { + "/v2/slides/{id}/playlists": { "get": { - "operationId": "put-v1-slide-playlist-id", + "operationId": "put-v2-slide-playlist-id", "tags": [ "Playlists" ], @@ -5125,7 +5125,7 @@ "deprecated": false }, "put": { - "operationId": "get-v1-slide-playlist-id", + "operationId": "get-v2-slide-playlist-id", "tags": [ "Playlists" ], @@ -5207,9 +5207,9 @@ }, "parameters": [] }, - "/v1/templates": { + "/v2/templates": { "get": { - "operationId": "get-v1-templates", + "operationId": "get-v2-templates", "tags": [ "Templates" ], @@ -5390,9 +5390,9 @@ }, "parameters": [] }, - "/v1/templates/{id}": { + "/v2/templates/{id}": { "get": { - "operationId": "get-v1-template-id", + "operationId": "get-v2-template-id", "tags": [ "Templates" ], @@ -5431,9 +5431,9 @@ }, "parameters": [] }, - "/v1/tenants": { + "/v2/tenants": { "get": { - "operationId": "get-v1-tenants", + "operationId": "get-v2-tenants", "tags": [ "Tenants" ], @@ -5578,9 +5578,9 @@ }, "parameters": [] }, - "/v1/tenants/{id}": { + "/v2/tenants/{id}": { "get": { - "operationId": "get-v1-tenant-id", + "operationId": "get-v2-tenant-id", "tags": [ "Tenants" ], @@ -5619,9 +5619,9 @@ }, "parameters": [] }, - "/v1/themes": { + "/v2/themes": { "get": { - "operationId": "get-v1-themes", + "operationId": "get-v2-themes", "tags": [ "Themes" ], @@ -5837,7 +5837,7 @@ "deprecated": false }, "post": { - "operationId": "create-v1-themes", + "operationId": "create-v2-themes", "tags": [ "Themes" ], @@ -5898,9 +5898,9 @@ }, "parameters": [] }, - "/v1/themes/{id}": { + "/v2/themes/{id}": { "get": { - "operationId": "get-v1-theme-id", + "operationId": "get-v2-theme-id", "tags": [ "Themes" ], @@ -5938,7 +5938,7 @@ "deprecated": false }, "put": { - "operationId": "put-v1-theme-id", + "operationId": "put-v2-theme-id", "tags": [ "Themes" ], @@ -6018,7 +6018,7 @@ "deprecated": false }, "delete": { - "operationId": "delete-v1-theme-id", + "operationId": "delete-v2-theme-id", "tags": [ "Themes" ], @@ -6054,9 +6054,9 @@ }, "parameters": [] }, - "/v1/user-activation-codes": { + "/v2/user-activation-codes": { "get": { - "operationId": "api_v1user-activation-codes_get_collection", + "operationId": "api_v2user-activation-codes_get_collection", "tags": [ "UserActivationCode" ], @@ -6215,7 +6215,7 @@ "deprecated": false }, "post": { - "operationId": "post-v1-create-user-activation-code", + "operationId": "post-v2-create-user-activation-code", "tags": [ "UserActivationCode" ], @@ -6276,9 +6276,9 @@ }, "parameters": [] }, - "/v1/user-activation-codes/activate": { + "/v2/user-activation-codes/activate": { "post": { - "operationId": "post-v1-activate-user-activation-code", + "operationId": "post-v2-activate-user-activation-code", "tags": [ "UserActivationCode" ], @@ -6339,9 +6339,9 @@ }, "parameters": [] }, - "/v1/user-activation-codes/refresh": { + "/v2/user-activation-codes/refresh": { "post": { - "operationId": "post-v1-refresh-user-activation-code", + "operationId": "post-v2-refresh-user-activation-code", "tags": [ "UserActivationCode" ], @@ -6402,9 +6402,9 @@ }, "parameters": [] }, - "/v1/user-activation-codes/{id}": { + "/v2/user-activation-codes/{id}": { "get": { - "operationId": "api_v1user-activation-codes_id_get", + "operationId": "api_v2user-activation-codes_id_get", "tags": [ "UserActivationCode" ], @@ -6454,7 +6454,7 @@ "deprecated": false }, "delete": { - "operationId": "api_v1user-activation-codes_id_delete", + "operationId": "api_v2user-activation-codes_id_delete", "tags": [ "UserActivationCode" ], @@ -6488,9 +6488,9 @@ }, "parameters": [] }, - "/v1/users": { + "/v2/users": { "get": { - "operationId": "get-v1-users", + "operationId": "get-v2-users", "tags": [ "User" ], @@ -6652,7 +6652,7 @@ "deprecated": false }, "post": { - "operationId": "post-v1-user", + "operationId": "post-v2-user", "tags": [ "User" ], @@ -6730,9 +6730,9 @@ }, "parameters": [] }, - "/v1/users/{id}": { + "/v2/users/{id}": { "get": { - "operationId": "get-v1-user-id", + "operationId": "get-v2-user-id", "tags": [ "User" ], @@ -6770,7 +6770,7 @@ "deprecated": false }, "put": { - "operationId": "put-v1-user-id", + "operationId": "put-v2-user-id", "tags": [ "User" ], @@ -6850,7 +6850,7 @@ "deprecated": false }, "delete": { - "operationId": "delete-v1-user-id", + "operationId": "delete-v2-user-id", "tags": [ "User" ], @@ -6886,9 +6886,9 @@ }, "parameters": [] }, - "/v1/users/{id}/remove-from-tenant": { + "/v2/users/{id}/remove-from-tenant": { "delete": { - "operationId": "post-v1-remove-user-from-tenant", + "operationId": "post-v2-remove-user-from-tenant", "tags": [ "User" ], @@ -10717,8 +10717,8 @@ } }, "inScreenGroups": { - "default": "/v1/screens/{id}/groups", - "example": "/v1/screens/{id}/groups", + "default": "/v2/screens/{id}/groups", + "example": "/v2/screens/{id}/groups", "type": "string" }, "screenUser": { @@ -10792,8 +10792,8 @@ } }, "inScreenGroups": { - "default": "/v1/screens/{id}/groups", - "example": "/v1/screens/{id}/groups", + "default": "/v2/screens/{id}/groups", + "example": "/v2/screens/{id}/groups", "type": "string" }, "screenUser": { @@ -10859,8 +10859,8 @@ } }, "inScreenGroups": { - "default": "/v1/screens/{id}/groups", - "example": "/v1/screens/{id}/groups", + "default": "/v2/screens/{id}/groups", + "example": "/v2/screens/{id}/groups", "type": "string" }, "screenUser": { @@ -10969,8 +10969,8 @@ } }, "inScreenGroups": { - "default": "/v1/screens/{id}/groups", - "example": "/v1/screens/{id}/groups", + "default": "/v2/screens/{id}/groups", + "example": "/v2/screens/{id}/groups", "type": "string" }, "screenUser": { @@ -11147,8 +11147,8 @@ } }, "inScreenGroups": { - "default": "/v1/screens/{id}/groups", - "example": "/v1/screens/{id}/groups", + "default": "/v2/screens/{id}/groups", + "example": "/v2/screens/{id}/groups", "type": "string" }, "screenUser": { @@ -11257,8 +11257,8 @@ } }, "inScreenGroups": { - "default": "/v1/screens/{id}/groups", - "example": "/v1/screens/{id}/groups", + "default": "/v2/screens/{id}/groups", + "example": "/v2/screens/{id}/groups", "type": "string" }, "screenUser": { diff --git a/public/api-spec-v1.yaml b/public/api-spec-v2.yaml old mode 100755 new mode 100644 similarity index 98% rename from public/api-spec-v1.yaml rename to public/api-spec-v2.yaml index c35a0ce3..53c73381 --- a/public/api-spec-v1.yaml +++ b/public/api-spec-v2.yaml @@ -10,7 +10,7 @@ servers: url: / description: '' paths: - /v1/authentication/oidc/token: + /v2/authentication/oidc/token: get: operationId: getOidcAuthTokenItem tags: @@ -41,7 +41,7 @@ paths: schema: type: string parameters: [] - /v1/authentication/oidc/urls: + /v2/authentication/oidc/urls: get: operationId: getOidcAuthUrlsItem tags: @@ -64,7 +64,7 @@ paths: schema: type: string parameters: [] - /v1/authentication/screen: + /v2/authentication/screen: post: operationId: postLoginInfoScreen tags: @@ -85,7 +85,7 @@ paths: $ref: '#/components/schemas/ScreenLoginInput' required: false parameters: [] - /v1/authentication/token: + /v2/authentication/token: post: operationId: login_check_post tags: @@ -121,7 +121,7 @@ paths: - password required: true parameters: [] - /v1/authentication/token/refresh: + /v2/authentication/token/refresh: post: operationId: postRefreshTokenItem tags: @@ -142,9 +142,9 @@ paths: $ref: '#/components/schemas/RefreshTokenRequest' required: false parameters: [] - '/v1/campaigns/{id}/screen-groups': + '/v2/campaigns/{id}/screen-groups': get: - operationId: get-v1-campaign-id-screen-group + operationId: get-v2-campaign-id-screen-group tags: - Playlists responses: @@ -218,9 +218,9 @@ paths: allowReserved: false deprecated: false parameters: [] - '/v1/campaigns/{id}/screens': + '/v2/campaigns/{id}/screens': get: - operationId: get-v1-campaign-id-screen + operationId: get-v2-campaign-id-screen tags: - Playlists responses: @@ -294,9 +294,9 @@ paths: allowReserved: false deprecated: false parameters: [] - /v1/feed-sources: + /v2/feed-sources: get: - operationId: get-v1-feed-sources + operationId: get-v2-feed-sources tags: - FeedSources responses: @@ -501,7 +501,7 @@ paths: allowReserved: false deprecated: false parameters: [] - '/v1/feed-sources/{id}': + '/v2/feed-sources/{id}': get: operationId: get-feed-source-id tags: @@ -532,9 +532,9 @@ paths: allowReserved: false deprecated: false parameters: [] - '/v1/feed_sources/{id}/config/{name}': + '/v2/feed_sources/{id}/config/{name}': get: - operationId: get-v1-feed-source-id-config-name + operationId: get-v2-feed-source-id-config-name tags: - FeedSources responses: @@ -577,9 +577,9 @@ paths: allowReserved: false deprecated: false parameters: [] - /v1/feeds: + /v2/feeds: get: - operationId: get-v1-feeds + operationId: get-v2-feeds tags: - Feeds responses: @@ -704,7 +704,7 @@ paths: allowReserved: false deprecated: false parameters: [] - '/v1/feeds/{id}': + '/v2/feeds/{id}': get: operationId: get-feeds-id tags: @@ -735,9 +735,9 @@ paths: allowReserved: false deprecated: false parameters: [] - '/v1/feeds/{id}/data': + '/v2/feeds/{id}/data': get: - operationId: get-v1-feed-id-data + operationId: get-v2-feed-id-data tags: - Feeds responses: @@ -769,9 +769,9 @@ paths: allowReserved: false deprecated: false parameters: [] - /v1/layouts: + /v2/layouts: get: - operationId: get-v1-layouts + operationId: get-v2-layouts tags: - Layouts responses: @@ -816,9 +816,9 @@ paths: allowReserved: false deprecated: false parameters: [] - '/v1/layouts/{id}': + '/v2/layouts/{id}': get: - operationId: get-v1-layouts-id + operationId: get-v2-layouts-id tags: - Layouts responses: @@ -847,9 +847,9 @@ paths: allowReserved: false deprecated: false parameters: [] - /v1/media: + /v2/media: get: - operationId: get-v1-medias + operationId: get-v2-medias tags: - Media responses: @@ -1076,9 +1076,9 @@ paths: required: false deprecated: false parameters: [] - '/v1/media/{id}': + '/v2/media/{id}': get: - operationId: getV1MediaById + operationId: getv2MediaById tags: - Media responses: @@ -1107,7 +1107,7 @@ paths: allowReserved: false deprecated: false delete: - operationId: delete-v1-media-id + operationId: delete-v2-media-id tags: - Media responses: @@ -1134,9 +1134,9 @@ paths: allowReserved: false deprecated: false parameters: [] - /v1/playlists: + /v2/playlists: get: - operationId: get-v1-playlists + operationId: get-v2-playlists tags: - Playlists responses: @@ -1353,7 +1353,7 @@ paths: allowReserved: false deprecated: false post: - operationId: create-v1-playlist + operationId: create-v2-playlist tags: - Playlists responses: @@ -1392,9 +1392,9 @@ paths: required: true deprecated: false parameters: [] - '/v1/playlists/{id}': + '/v2/playlists/{id}': get: - operationId: get-v1-playlist-id + operationId: get-v2-playlist-id tags: - Playlists responses: @@ -1423,7 +1423,7 @@ paths: allowReserved: false deprecated: false put: - operationId: put-v1-playlist-id + operationId: put-v2-playlist-id tags: - Playlists responses: @@ -1478,7 +1478,7 @@ paths: required: true deprecated: false delete: - operationId: delete-v1-playlist-id + operationId: delete-v2-playlist-id tags: - Playlists responses: @@ -1505,9 +1505,9 @@ paths: allowReserved: false deprecated: false parameters: [] - '/v1/playlists/{id}/slides': + '/v2/playlists/{id}/slides': get: - operationId: get-v1-playlist-slide-id + operationId: get-v2-playlist-slide-id tags: - Playlists responses: @@ -1576,7 +1576,7 @@ paths: allowReserved: false deprecated: false put: - operationId: put-v1-playlist-slide-id + operationId: put-v2-playlist-slide-id tags: - Playlists responses: @@ -1618,9 +1618,9 @@ paths: required: false deprecated: false parameters: [] - '/v1/playlists/{id}/slides/{slideId}': + '/v2/playlists/{id}/slides/{slideId}': delete: - operationId: delete-v1-playlist-slide-id + operationId: delete-v2-playlist-slide-id tags: - Playlists responses: @@ -1661,9 +1661,9 @@ paths: allowReserved: false deprecated: false parameters: [] - /v1/screen-groups: + /v2/screen-groups: get: - operationId: get-v1-screen-groups + operationId: get-v2-screen-groups tags: - ScreenGroups responses: @@ -1827,7 +1827,7 @@ paths: allowReserved: false deprecated: false post: - operationId: post-v1-screen-groups + operationId: post-v2-screen-groups tags: - ScreenGroups responses: @@ -1866,7 +1866,7 @@ paths: required: true deprecated: false parameters: [] - '/v1/screen-groups-campaigns/{id}': + '/v2/screen-groups-campaigns/{id}': get: operationId: getScreenGroupCampaignItem tags: @@ -1903,9 +1903,9 @@ paths: allowReserved: false deprecated: false parameters: [] - '/v1/screen-groups/{id}': + '/v2/screen-groups/{id}': get: - operationId: get-v1-screen-groups-id + operationId: get-v2-screen-groups-id tags: - ScreenGroups responses: @@ -1934,7 +1934,7 @@ paths: allowReserved: false deprecated: false put: - operationId: put-v1-screen-groups-id + operationId: put-v2-screen-groups-id tags: - ScreenGroups responses: @@ -1989,7 +1989,7 @@ paths: required: true deprecated: false delete: - operationId: delete-v1-screen-groups-id + operationId: delete-v2-screen-groups-id tags: - ScreenGroups responses: @@ -2016,9 +2016,9 @@ paths: allowReserved: false deprecated: false parameters: [] - '/v1/screen-groups/{id}/campaigns': + '/v2/screen-groups/{id}/campaigns': get: - operationId: get-v1-screen-groups-campaign-id + operationId: get-v2-screen-groups-campaign-id tags: - ScreenGroups responses: @@ -2087,7 +2087,7 @@ paths: allowReserved: false deprecated: false put: - operationId: put-v1-screen-groups-campaign-id + operationId: put-v2-screen-groups-campaign-id tags: - ScreenGroups responses: @@ -2128,9 +2128,9 @@ paths: required: false deprecated: false parameters: [] - '/v1/screen-groups/{id}/campaigns/{campaignId}': + '/v2/screen-groups/{id}/campaigns/{campaignId}': delete: - operationId: delete-v1-screen-groups-campaign-id + operationId: delete-v2-screen-groups-campaign-id tags: - ScreenGroups responses: @@ -2171,9 +2171,9 @@ paths: allowReserved: false deprecated: false parameters: [] - '/v1/screen-groups/{id}/screens': + '/v2/screen-groups/{id}/screens': get: - operationId: get-v1-screen-id-screen-group + operationId: get-v2-screen-id-screen-group tags: - ScreenGroups responses: @@ -2247,9 +2247,9 @@ paths: allowReserved: false deprecated: false parameters: [] - /v1/screens: + /v2/screens: get: - operationId: get-v1-screens + operationId: get-v2-screens tags: - Screens responses: @@ -2416,7 +2416,7 @@ paths: allowReserved: false deprecated: false post: - operationId: create-v1-screens + operationId: create-v2-screens tags: - Screens responses: @@ -2455,7 +2455,7 @@ paths: required: true deprecated: false parameters: [] - '/v1/screens/{id}': + '/v2/screens/{id}': get: operationId: get-screens-id tags: @@ -2486,7 +2486,7 @@ paths: allowReserved: false deprecated: false put: - operationId: put-v1-screen-id + operationId: put-v2-screen-id tags: - Screens responses: @@ -2541,7 +2541,7 @@ paths: required: true deprecated: false delete: - operationId: delete-v1-screen-id + operationId: delete-v2-screen-id tags: - Screens responses: @@ -2568,7 +2568,7 @@ paths: allowReserved: false deprecated: false parameters: [] - '/v1/screens/{id}/bind': + '/v2/screens/{id}/bind': post: operationId: postScreenBindKey tags: @@ -2598,9 +2598,9 @@ paths: $ref: '#/components/schemas/ScreenBindObject' required: false parameters: [] - '/v1/screens/{id}/campaigns': + '/v2/screens/{id}/campaigns': get: - operationId: get-v1-screen-campaign-id + operationId: get-v2-screen-campaign-id tags: - Screens responses: @@ -2669,7 +2669,7 @@ paths: allowReserved: false deprecated: false put: - operationId: put-v1-screen-campaign-id + operationId: put-v2-screen-campaign-id tags: - Screens responses: @@ -2710,9 +2710,9 @@ paths: required: false deprecated: false parameters: [] - '/v1/screens/{id}/campaigns/{campaignId}': + '/v2/screens/{id}/campaigns/{campaignId}': delete: - operationId: delete-v1-screen-campaign-id + operationId: delete-v2-screen-campaign-id tags: - Screens responses: @@ -2753,9 +2753,9 @@ paths: allowReserved: false deprecated: false parameters: [] - '/v1/screens/{id}/regions/{regionId}/playlists': + '/v2/screens/{id}/regions/{regionId}/playlists': get: - operationId: get-v1-playlist-screen-regions + operationId: get-v2-playlist-screen-regions tags: - Screens responses: @@ -2910,7 +2910,7 @@ paths: required: false deprecated: false parameters: [] - '/v1/screens/{id}/regions/{regionId}/playlists/{playlistId}': + '/v2/screens/{id}/regions/{regionId}/playlists/{playlistId}': delete: operationId: deletePlaylistScreenRegionItem tags: @@ -2967,9 +2967,9 @@ paths: allowReserved: false deprecated: false parameters: [] - '/v1/screens/{id}/screen-groups': + '/v2/screens/{id}/screen-groups': get: - operationId: get-v1-screen-id-screen-groups + operationId: get-v2-screen-id-screen-groups tags: - Screens responses: @@ -3073,7 +3073,7 @@ paths: allowReserved: false deprecated: false put: - operationId: put-v1-screen-groups-screen + operationId: put-v2-screen-groups-screen tags: - Screens responses: @@ -3110,9 +3110,9 @@ paths: required: false deprecated: false parameters: [] - '/v1/screens/{id}/screen-groups/{screenGroupId}': + '/v2/screens/{id}/screen-groups/{screenGroupId}': delete: - operationId: delete-v1-screen-group-screen-id + operationId: delete-v2-screen-group-screen-id tags: - Screens responses: @@ -3153,7 +3153,7 @@ paths: allowReserved: false deprecated: false parameters: [] - '/v1/screens/{id}/unbind': + '/v2/screens/{id}/unbind': post: operationId: postScreenUnbind tags: @@ -3180,9 +3180,9 @@ paths: content: { } required: false parameters: [] - /v1/slides: + /v2/slides: get: - operationId: get-v1-slides + operationId: get-v2-slides tags: - Slides responses: @@ -3373,7 +3373,7 @@ paths: allowReserved: false deprecated: false post: - operationId: create-v1-slides + operationId: create-v2-slides tags: - Slides responses: @@ -3412,9 +3412,9 @@ paths: required: true deprecated: false parameters: [] - '/v1/slides/{id}': + '/v2/slides/{id}': get: - operationId: get-v1-slide-id + operationId: get-v2-slide-id tags: - Slides responses: @@ -3443,7 +3443,7 @@ paths: allowReserved: false deprecated: false put: - operationId: put-v1-slide-id + operationId: put-v2-slide-id tags: - Slides responses: @@ -3498,7 +3498,7 @@ paths: required: true deprecated: false delete: - operationId: delete-v1-slide-id + operationId: delete-v2-slide-id tags: - Slides responses: @@ -3525,9 +3525,9 @@ paths: allowReserved: false deprecated: false parameters: [] - '/v1/slides/{id}/playlists': + '/v2/slides/{id}/playlists': get: - operationId: put-v1-slide-playlist-id + operationId: put-v2-slide-playlist-id tags: - Playlists responses: @@ -3596,7 +3596,7 @@ paths: allowReserved: false deprecated: false put: - operationId: get-v1-slide-playlist-id + operationId: get-v2-slide-playlist-id tags: - Playlists responses: @@ -3649,9 +3649,9 @@ paths: required: false deprecated: false parameters: [] - /v1/templates: + /v2/templates: get: - operationId: get-v1-templates + operationId: get-v2-templates tags: - Templates responses: @@ -3800,9 +3800,9 @@ paths: allowReserved: false deprecated: false parameters: [] - '/v1/templates/{id}': + '/v2/templates/{id}': get: - operationId: get-v1-template-id + operationId: get-v2-template-id tags: - Templates responses: @@ -3831,9 +3831,9 @@ paths: allowReserved: false deprecated: false parameters: [] - /v1/tenants: + /v2/tenants: get: - operationId: get-v1-tenants + operationId: get-v2-tenants tags: - Tenants responses: @@ -3952,9 +3952,9 @@ paths: allowReserved: false deprecated: false parameters: [] - '/v1/tenants/{id}': + '/v2/tenants/{id}': get: - operationId: get-v1-tenant-id + operationId: get-v2-tenant-id tags: - Tenants responses: @@ -3983,9 +3983,9 @@ paths: allowReserved: false deprecated: false parameters: [] - /v1/themes: + /v2/themes: get: - operationId: get-v1-themes + operationId: get-v2-themes tags: - Themes responses: @@ -4164,7 +4164,7 @@ paths: allowReserved: false deprecated: false post: - operationId: create-v1-themes + operationId: create-v2-themes tags: - Themes responses: @@ -4203,9 +4203,9 @@ paths: required: true deprecated: false parameters: [] - '/v1/themes/{id}': + '/v2/themes/{id}': get: - operationId: get-v1-theme-id + operationId: get-v2-theme-id tags: - Themes responses: @@ -4234,7 +4234,7 @@ paths: allowReserved: false deprecated: false put: - operationId: put-v1-theme-id + operationId: put-v2-theme-id tags: - Themes responses: @@ -4289,7 +4289,7 @@ paths: required: true deprecated: false delete: - operationId: delete-v1-theme-id + operationId: delete-v2-theme-id tags: - Themes responses: @@ -4316,9 +4316,9 @@ paths: allowReserved: false deprecated: false parameters: [] - /v1/user-activation-codes: + /v2/user-activation-codes: get: - operationId: api_v1user-activation-codes_get_collection + operationId: api_v2user-activation-codes_get_collection tags: - UserActivationCode responses: @@ -4378,7 +4378,7 @@ paths: allowReserved: false deprecated: false post: - operationId: post-v1-create-user-activation-code + operationId: post-v2-create-user-activation-code tags: - UserActivationCode responses: @@ -4417,9 +4417,9 @@ paths: required: true deprecated: false parameters: [] - /v1/user-activation-codes/activate: + /v2/user-activation-codes/activate: post: - operationId: post-v1-activate-user-activation-code + operationId: post-v2-activate-user-activation-code tags: - UserActivationCode responses: @@ -4458,9 +4458,9 @@ paths: required: true deprecated: false parameters: [] - /v1/user-activation-codes/refresh: + /v2/user-activation-codes/refresh: post: - operationId: post-v1-refresh-user-activation-code + operationId: post-v2-refresh-user-activation-code tags: - UserActivationCode responses: @@ -4499,9 +4499,9 @@ paths: required: true deprecated: false parameters: [] - '/v1/user-activation-codes/{id}': + '/v2/user-activation-codes/{id}': get: - operationId: api_v1user-activation-codes_id_get + operationId: api_v2user-activation-codes_id_get tags: - UserActivationCode responses: @@ -4536,7 +4536,7 @@ paths: allowReserved: false deprecated: false delete: - operationId: api_v1user-activation-codes_id_delete + operationId: api_v2user-activation-codes_id_delete tags: - UserActivationCode responses: @@ -4561,9 +4561,9 @@ paths: allowReserved: false deprecated: false parameters: [] - /v1/users: + /v2/users: get: - operationId: get-v1-users + operationId: get-v2-users tags: - User responses: @@ -4697,7 +4697,7 @@ paths: allowReserved: false deprecated: false post: - operationId: post-v1-user + operationId: post-v2-user tags: - User responses: @@ -4750,9 +4750,9 @@ paths: required: true deprecated: false parameters: [] - '/v1/users/{id}': + '/v2/users/{id}': get: - operationId: get-v1-user-id + operationId: get-v2-user-id tags: - User responses: @@ -4781,7 +4781,7 @@ paths: allowReserved: false deprecated: false put: - operationId: put-v1-user-id + operationId: put-v2-user-id tags: - User responses: @@ -4836,7 +4836,7 @@ paths: required: true deprecated: false delete: - operationId: delete-v1-user-id + operationId: delete-v2-user-id tags: - User responses: @@ -4863,9 +4863,9 @@ paths: allowReserved: false deprecated: false parameters: [] - '/v1/users/{id}/remove-from-tenant': + '/v2/users/{id}/remove-from-tenant': delete: - operationId: post-v1-remove-user-from-tenant + operationId: post-v2-remove-user-from-tenant tags: - User responses: @@ -7458,8 +7458,8 @@ components: items: type: string inScreenGroups: - default: '/v1/screens/{id}/groups' - example: '/v1/screens/{id}/groups' + default: '/v2/screens/{id}/groups' + example: '/v2/screens/{id}/groups' type: string screenUser: type: @@ -7510,8 +7510,8 @@ components: items: type: string inScreenGroups: - default: '/v1/screens/{id}/groups' - example: '/v1/screens/{id}/groups' + default: '/v2/screens/{id}/groups' + example: '/v2/screens/{id}/groups' type: string screenUser: type: @@ -7556,8 +7556,8 @@ components: items: type: string inScreenGroups: - default: '/v1/screens/{id}/groups' - example: '/v1/screens/{id}/groups' + default: '/v2/screens/{id}/groups' + example: '/v2/screens/{id}/groups' type: string screenUser: type: @@ -7631,8 +7631,8 @@ components: items: type: string inScreenGroups: - default: '/v1/screens/{id}/groups' - example: '/v1/screens/{id}/groups' + default: '/v2/screens/{id}/groups' + example: '/v2/screens/{id}/groups' type: string screenUser: type: @@ -7752,8 +7752,8 @@ components: items: type: string inScreenGroups: - default: '/v1/screens/{id}/groups' - example: '/v1/screens/{id}/groups' + default: '/v2/screens/{id}/groups' + example: '/v2/screens/{id}/groups' type: string screenUser: type: @@ -7827,8 +7827,8 @@ components: items: type: string inScreenGroups: - default: '/v1/screens/{id}/groups' - example: '/v1/screens/{id}/groups' + default: '/v2/screens/{id}/groups' + example: '/v2/screens/{id}/groups' type: string screenUser: type: diff --git a/src/Controller/AuthOidcController.php b/src/Controller/AuthOidcController.php index c1d46001..c913d880 100644 --- a/src/Controller/AuthOidcController.php +++ b/src/Controller/AuthOidcController.php @@ -31,7 +31,7 @@ public function __construct( private readonly AuthenticationFailureHandler $failureHandler ) {} - #[Route('/v1/authentication/oidc/token', name: 'authentication_oidc_token', methods: ['GET'])] + #[Route('/v2/authentication/oidc/token', name: 'authentication_oidc_token', methods: ['GET'])] public function getToken(Request $request): Response { if ($request->query->has('state') && $request->query->has('code')) { @@ -51,7 +51,7 @@ public function getToken(Request $request): Response } } - #[Route('/v1/authentication/oidc/urls', name: 'authentication_oidc_urls', methods: ['GET'])] + #[Route('/v2/authentication/oidc/urls', name: 'authentication_oidc_urls', methods: ['GET'])] public function getUrls(Request $request, SessionInterface $session): Response { $providerKey = $request->query->get('providerKey'); diff --git a/src/Dto/Screen.php b/src/Dto/Screen.php index 48800167..6ae28510 100644 --- a/src/Dto/Screen.php +++ b/src/Dto/Screen.php @@ -45,7 +45,7 @@ class Screen public array $regions = []; #[Groups(['campaigns/screens:read', 'screen-groups/screens:read'])] - public string $inScreenGroups = '/v1/screens/{id}/groups'; + public string $inScreenGroups = '/v2/screens/{id}/groups'; #[Groups(['campaigns/screens:read', 'screen-groups/screens:read'])] public ?string $screenUser = null; diff --git a/src/OpenApi/OpenApiFactory.php b/src/OpenApi/OpenApiFactory.php index 209ede5b..e3a5e56d 100644 --- a/src/OpenApi/OpenApiFactory.php +++ b/src/OpenApi/OpenApiFactory.php @@ -185,7 +185,7 @@ public function __invoke(array $context = []): OpenApi ), ), ); - $openApi->getPaths()->addPath('/v1/authentication/token', $tokenPathItem); + $openApi->getPaths()->addPath('/v2/authentication/token', $tokenPathItem); $refreshTokenPathItem = new Model\PathItem( post: new Model\Operation( @@ -216,7 +216,7 @@ public function __invoke(array $context = []): OpenApi ), ), ); - $openApi->getPaths()->addPath('/v1/authentication/token/refresh', $refreshTokenPathItem); + $openApi->getPaths()->addPath('/v2/authentication/token/refresh', $refreshTokenPathItem); $oidcUrlsPathItem = new Model\PathItem( get: new Model\Operation( @@ -249,7 +249,7 @@ public function __invoke(array $context = []): OpenApi ] ), ); - $openApi->getPaths()->addPath('/v1/authentication/oidc/urls', $oidcUrlsPathItem); + $openApi->getPaths()->addPath('/v2/authentication/oidc/urls', $oidcUrlsPathItem); $oidcTokenPathItem = new Model\PathItem( get: new Model\Operation( @@ -292,7 +292,7 @@ public function __invoke(array $context = []): OpenApi ] ), ); - $openApi->getPaths()->addPath('/v1/authentication/oidc/token', $oidcTokenPathItem); + $openApi->getPaths()->addPath('/v2/authentication/oidc/token', $oidcTokenPathItem); $schemas['ScreenLoginOutput'] = new \ArrayObject([ 'type' => 'object', @@ -341,7 +341,7 @@ public function __invoke(array $context = []): OpenApi ), ), ); - $openApi->getPaths()->addPath('/v1/authentication/screen', $screenPathItem); + $openApi->getPaths()->addPath('/v2/authentication/screen', $screenPathItem); $schemas['ScreenBindObject'] = new \ArrayObject([ 'type' => 'object', @@ -386,7 +386,7 @@ public function __invoke(array $context = []): OpenApi ), ), ); - $openApi->getPaths()->addPath('/v1/screens/{id}/bind', $screenBindItem); + $openApi->getPaths()->addPath('/v2/screens/{id}/bind', $screenBindItem); $screenUnbindItem = new Model\PathItem( post: new Model\Operation( @@ -416,7 +416,7 @@ public function __invoke(array $context = []): OpenApi ), ), ); - $openApi->getPaths()->addPath('/v1/screens/{id}/unbind', $screenUnbindItem); + $openApi->getPaths()->addPath('/v2/screens/{id}/unbind', $screenUnbindItem); // Remove sub-resource with these paths. $exclude = [ diff --git a/tests/Api/AuthenticationScreenTest.php b/tests/Api/AuthenticationScreenTest.php index 6a08e525..ba12c29c 100644 --- a/tests/Api/AuthenticationScreenTest.php +++ b/tests/Api/AuthenticationScreenTest.php @@ -22,7 +22,7 @@ public function testBindKeyUnchanged(): void // Disable kernel reboot between requests to avoid session data reset. $screenClient->disableReboot(); - $request1 = $screenClient->request('POST', '/v1/authentication/screen', [ + $request1 = $screenClient->request('POST', '/v2/authentication/screen', [ 'headers' => ['Content-Type' => 'application/json'], ]); @@ -32,7 +32,7 @@ public function testBindKeyUnchanged(): void $this->assertEquals(8, strlen((string) $content1->bindKey)); $this->assertEquals('awaitingBindKey', $content1->status); - $request2 = $screenClient->request('POST', '/v1/authentication/screen', [ + $request2 = $screenClient->request('POST', '/v2/authentication/screen', [ 'headers' => ['Content-Type' => 'application/json'], ]); @@ -57,7 +57,7 @@ public function testScreenBindSuccess(): void // Step 1 (Screen): // Screen client is started. Client is unauthenticated and receives bind key. - $response1 = $screenClient->request('POST', '/v1/authentication/screen', [ + $response1 = $screenClient->request('POST', '/v2/authentication/screen', [ 'headers' => ['Content-Type' => 'application/json'], ]); $content1 = json_decode($response1->getContent(), null, 512, JSON_THROW_ON_ERROR); @@ -81,7 +81,7 @@ public function testScreenBindSuccess(): void // Step 3 (Screen): // Client has been bound by admin and receives tokens. $time = new \DateTimeImmutable(); - $response3 = $screenClient->request('POST', '/v1/authentication/screen', [ + $response3 = $screenClient->request('POST', '/v2/authentication/screen', [ 'headers' => ['Content-Type' => 'application/json'], ]); $content3 = json_decode($response3->getContent(), null, 512, JSON_THROW_ON_ERROR); @@ -113,7 +113,7 @@ public function testScreenBindSuccess(): void // Step 4 (Screen): // Refresh jwt and refresh token $time = new \DateTimeImmutable(); - $response4 = $screenClient->request('POST', '/v1/authentication/token/refresh', [ + $response4 = $screenClient->request('POST', '/v2/authentication/token/refresh', [ 'headers' => ['Content-Type' => 'application/json'], 'json' => [ 'refresh_token' => $content3->refresh_token, diff --git a/tests/Api/AuthenticationUserTest.php b/tests/Api/AuthenticationUserTest.php index 175695bb..f277605d 100644 --- a/tests/Api/AuthenticationUserTest.php +++ b/tests/Api/AuthenticationUserTest.php @@ -47,7 +47,7 @@ public function testLogin(): void $manager->flush(); // retrieve a token - $response = $client->request('POST', '/v1/authentication/token', [ + $response = $client->request('POST', '/v2/authentication/token', [ 'headers' => ['Content-Type' => 'application/json'], 'json' => [ 'providerId' => 'test@example.com', @@ -75,15 +75,15 @@ public function testLogin(): void $this->assertEqualsWithDelta($expectedRefresh, $content->refresh_token_expiration, 1.0); // test unauthorized if token not set - $client->request('GET', '/v1/slides'); + $client->request('GET', '/v2/slides'); $this->assertResponseStatusCodeSame(401); // test unauthorized if wrong token set - $client->request('GET', '/v1/slides', ['auth_bearer' => 'no-token']); + $client->request('GET', '/v2/slides', ['auth_bearer' => 'no-token']); $this->assertResponseStatusCodeSame(401); // test unauthorized if wrong tenant set - $client->request('GET', '/v1/slides', [ + $client->request('GET', '/v2/slides', [ 'auth_bearer' => 'no-token', 'headers' => [ TenantScopedAuthenticator::AUTH_TENANT_ID_HEADER => 'XYZ', @@ -92,11 +92,11 @@ public function testLogin(): void $this->assertResponseStatusCodeSame(401); // test authorized without tenant Default to first tenant in users tenant list) - $client->request('GET', '/v1/slides', ['auth_bearer' => $content->token]); + $client->request('GET', '/v2/slides', ['auth_bearer' => $content->token]); $this->assertResponseIsSuccessful(); // test authorized without tenant (default to first tenant in users tenant list) - $client->request('GET', '/v1/slides', [ + $client->request('GET', '/v2/slides', [ 'auth_bearer' => $content->token, 'headers' => [ TenantScopedAuthenticator::AUTH_TENANT_ID_HEADER => 'ABC', diff --git a/tests/Api/FeedSourceTest.php b/tests/Api/FeedSourceTest.php index c4fbf668..50457efc 100644 --- a/tests/Api/FeedSourceTest.php +++ b/tests/Api/FeedSourceTest.php @@ -12,17 +12,17 @@ class FeedSourceTest extends AbstractBaseApiTestCase public function testGetCollection(): void { $client = $this->getAuthenticatedClient(); - $response = $client->request('GET', '/v1/feed-sources?itemsPerPage=10', ['headers' => ['Content-Type' => 'application/ld+json']]); + $response = $client->request('GET', '/v2/feed-sources?itemsPerPage=10', ['headers' => ['Content-Type' => 'application/ld+json']]); $this->assertResponseIsSuccessful(); $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); $this->assertJsonContains([ '@context' => '/contexts/FeedSource', - '@id' => '/v1/feed-sources', + '@id' => '/v2/feed-sources', '@type' => 'hydra:Collection', 'hydra:totalItems' => 1, 'hydra:view' => [ - '@id' => '/v1/feed-sources?itemsPerPage=10', + '@id' => '/v2/feed-sources?itemsPerPage=10', '@type' => 'hydra:PartialCollectionView', ], ]); diff --git a/tests/Api/GetTenantTest.php b/tests/Api/GetTenantTest.php index 4ebca710..6c5156a8 100644 --- a/tests/Api/GetTenantTest.php +++ b/tests/Api/GetTenantTest.php @@ -10,13 +10,13 @@ class GetTenantTest extends AbstractBaseApiTestCase { public function testGetCollection(): void { - $response = $this->getAuthenticatedClient()->request('GET', '/v1/tenants?itemsPerPage=10', ['headers' => ['Content-Type' => 'application/ld+json']]); + $response = $this->getAuthenticatedClient()->request('GET', '/v2/tenants?itemsPerPage=10', ['headers' => ['Content-Type' => 'application/ld+json']]); $this->assertResponseIsSuccessful(); $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); $this->assertJsonContains([ '@context' => '/contexts/Tenant', - '@id' => '/v1/tenants', + '@id' => '/v2/tenants', '@type' => 'hydra:Collection', 'hydra:totalItems' => 3, ]); diff --git a/tests/Api/LayoutsTest.php b/tests/Api/LayoutsTest.php index b4ddc9d9..ba9980fd 100644 --- a/tests/Api/LayoutsTest.php +++ b/tests/Api/LayoutsTest.php @@ -13,17 +13,17 @@ public function testGetLayoutCollection(): void { $client = $this->getAuthenticatedClient(); - $response = $client->request('GET', '/v1/layouts?itemsPerPage=2', ['headers' => ['Content-Type' => 'application/ld+json']]); + $response = $client->request('GET', '/v2/layouts?itemsPerPage=2', ['headers' => ['Content-Type' => 'application/ld+json']]); $this->assertResponseIsSuccessful(); $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); $this->assertJsonContains([ '@context' => '/contexts/ScreenLayout', - '@id' => '/v1/layouts', + '@id' => '/v2/layouts', '@type' => 'hydra:Collection', 'hydra:totalItems' => 2, 'hydra:view' => [ - '@id' => '/v1/layouts?itemsPerPage=2', + '@id' => '/v2/layouts?itemsPerPage=2', '@type' => 'hydra:PartialCollectionView', ], ]); diff --git a/tests/Api/MediaTest.php b/tests/Api/MediaTest.php index f7f9a93f..a18189a0 100644 --- a/tests/Api/MediaTest.php +++ b/tests/Api/MediaTest.php @@ -12,21 +12,21 @@ class MediaTest extends AbstractBaseApiTestCase { public function testGetCollection(): void { - $response = $this->getAuthenticatedClient()->request('GET', '/v1/media?itemsPerPage=10', ['headers' => ['Content-Type' => 'application/ld+json']]); + $response = $this->getAuthenticatedClient()->request('GET', '/v2/media?itemsPerPage=10', ['headers' => ['Content-Type' => 'application/ld+json']]); $this->assertResponseIsSuccessful(); $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); $this->assertJsonContains([ '@context' => '/contexts/Media', - '@id' => '/v1/media', + '@id' => '/v2/media', '@type' => 'hydra:Collection', 'hydra:totalItems' => 100, 'hydra:view' => [ - '@id' => '/v1/media?itemsPerPage=10&page=1', + '@id' => '/v2/media?itemsPerPage=10&page=1', '@type' => 'hydra:PartialCollectionView', - 'hydra:first' => '/v1/media?itemsPerPage=10&page=1', - 'hydra:last' => '/v1/media?itemsPerPage=10&page=10', - 'hydra:next' => '/v1/media?itemsPerPage=10&page=2', + 'hydra:first' => '/v2/media?itemsPerPage=10&page=1', + 'hydra:last' => '/v2/media?itemsPerPage=10&page=10', + 'hydra:next' => '/v2/media?itemsPerPage=10&page=2', ], ]); @@ -99,7 +99,7 @@ public function testMediaUpload(): void file_put_contents($tmpFile, file_get_contents('fixtures/files/test.jpg')); $file = new UploadedFile($tmpFile, 'test.jpg'); - $response = $this->getAuthenticatedClient()->request('POST', '/v1/media', [ + $response = $this->getAuthenticatedClient()->request('POST', '/v2/media', [ 'extra' => [ 'parameters' => [ 'title' => 'Test media', diff --git a/tests/Api/PlaylistScreenRegionTest.php b/tests/Api/PlaylistScreenRegionTest.php index b1bcf1aa..dc7c6201 100644 --- a/tests/Api/PlaylistScreenRegionTest.php +++ b/tests/Api/PlaylistScreenRegionTest.php @@ -22,14 +22,14 @@ public function testGetPlaylistsInScreenRegion(): void $iri = $this->findIriBy(ScreenLayoutRegions::class, []); $regionUlid = $this->iriHelperUtils->getUlidFromIRI($iri); - $url = '/v1/screens/'.$screenUlid.'/regions/'.$regionUlid.'/playlists?itemsPerPage=5'; + $url = '/v2/screens/'.$screenUlid.'/regions/'.$regionUlid.'/playlists?itemsPerPage=5'; $client->request('GET', $url, ['headers' => ['Content-Type' => 'application/ld+json']]); $this->assertResponseIsSuccessful(); $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); $this->assertJsonContains([ '@context' => '/contexts/PlaylistScreenRegion', - '@id' => '/v1/screens/'.$screenUlid.'/regions/'.$regionUlid.'/playlists', + '@id' => '/v2/screens/'.$screenUlid.'/regions/'.$regionUlid.'/playlists', '@type' => 'hydra:Collection', ]); } @@ -47,7 +47,7 @@ public function testLinkRegionPlaylist(): void $iri = $this->findIriBy(Playlist::class, ['tenant' => $this->tenant]); $playlistUlid = $this->iriHelperUtils->getUlidFromIRI($iri); - $url = '/v1/screens/'.$screenUlid.'/regions/'.$regionsUlid.'/playlists'; + $url = '/v2/screens/'.$screenUlid.'/regions/'.$regionsUlid.'/playlists'; $client->request('PUT', $url, [ 'json' => [ (object) [ @@ -85,7 +85,7 @@ public function testUnlinkRegionPlaylist(): void $iri = $this->findIriBy(ScreenLayoutRegions::class, []); $regionsUlid = $this->iriHelperUtils->getUlidFromIRI($iri); - $url = '/v1/screens/'.$screenUlid.'/regions/'.$regionsUlid.'/playlists'; + $url = '/v2/screens/'.$screenUlid.'/regions/'.$regionsUlid.'/playlists'; // Ensure link exists and is created before deleting it. $client->request('PUT', $url, [ diff --git a/tests/Api/PlaylistSlideTest.php b/tests/Api/PlaylistSlideTest.php index 795e6ab3..a951b3d6 100644 --- a/tests/Api/PlaylistSlideTest.php +++ b/tests/Api/PlaylistSlideTest.php @@ -20,12 +20,12 @@ public function testGetSlidePlaylists(): void $iri = $this->findIriBy(Slide::class, ['tenant' => $this->tenant]); $slideUlid = $this->iriHelperUtils->getUlidFromIRI($iri); - $client->request('GET', '/v1/slides/'.$slideUlid.'/playlists'); + $client->request('GET', '/v2/slides/'.$slideUlid.'/playlists'); $this->assertResponseIsSuccessful(); $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); $this->assertJsonContains([ '@context' => '/contexts/PlaylistSlide', - '@id' => '/v1/slides/'.$slideUlid.'/playlists', + '@id' => '/v2/slides/'.$slideUlid.'/playlists', '@type' => 'hydra:Collection', ]); } @@ -49,7 +49,7 @@ public function testLinkPlaylistToSlide(): void // Fixtures should give us two relations $this->assertCount(2, $relationsBefore, 'Fixtures invalid'); - $client->request('PUT', '/v1/slides/'.$slideUlid.'/playlists', [ + $client->request('PUT', '/v2/slides/'.$slideUlid.'/playlists', [ 'json' => [ (object) [ 'playlist' => $playlistUlid1, @@ -69,7 +69,7 @@ public function testLinkPlaylistToSlide(): void // PUT'ing one relation should overwrite existing $this->assertCount(1, $relationsAfter); - $client->request('PUT', '/v1/slides/'.$slideUlid.'/playlists', [ + $client->request('PUT', '/v2/slides/'.$slideUlid.'/playlists', [ 'json' => [ (object) [ 'playlist' => $playlistUlid1, @@ -105,7 +105,7 @@ public function testLinkSlideToPlaylist(): void $iri = $this->findIriBy(Slide::class, ['tenant' => $this->tenant, 'title' => 'slide_abc_3']); $slideUlid2 = $this->iriHelperUtils->getUlidFromIRI($iri); - $client->request('PUT', '/v1/playlists/'.$playlistUlid.'/slides', [ + $client->request('PUT', '/v2/playlists/'.$playlistUlid.'/slides', [ 'json' => [ (object) [ 'slide' => $slideUlid1, @@ -140,13 +140,13 @@ public function testGetSlidesList(): void $iri = $this->findIriBy(Playlist::class, ['tenant' => $this->tenant]); $ulid = $this->iriHelperUtils->getUlidFromIRI($iri); - $client->request('GET', '/v1/playlists/'.$ulid.'/slides?page=1&itemsPerPage=10', ['headers' => ['Content-Type' => 'application/ld+json']]); + $client->request('GET', '/v2/playlists/'.$ulid.'/slides?page=1&itemsPerPage=10', ['headers' => ['Content-Type' => 'application/ld+json']]); $this->assertResponseIsSuccessful(); $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); $this->assertJsonContains([ '@context' => '/contexts/PlaylistSlide', - '@id' => '/v1/playlists/'.$ulid.'/slides', + '@id' => '/v2/playlists/'.$ulid.'/slides', '@type' => 'hydra:Collection', ]); } @@ -164,7 +164,7 @@ public function testUnlinkSlide(): void $slideUlid2 = $this->iriHelperUtils->getUlidFromIRI($iri); // First create relations to ensure they exist before deleting theme. - $client->request('PUT', '/v1/playlists/'.$playlistUlid.'/slides', [ + $client->request('PUT', '/v2/playlists/'.$playlistUlid.'/slides', [ 'json' => [ (object) [ 'slide' => $slideUlid1, @@ -181,13 +181,13 @@ public function testUnlinkSlide(): void ]); $this->assertResponseStatusCodeSame(201); - $client->request('DELETE', '/v1/playlists/'.$playlistUlid.'/slides/'.$slideUlid1, [ + $client->request('DELETE', '/v2/playlists/'.$playlistUlid.'/slides/'.$slideUlid1, [ 'headers' => [ 'Content-Type' => 'application/ld+json', ], ]); $this->assertResponseStatusCodeSame(204); - $client->request('DELETE', '/v1/playlists/'.$playlistUlid.'/slides/'.$slideUlid2, [ + $client->request('DELETE', '/v2/playlists/'.$playlistUlid.'/slides/'.$slideUlid2, [ 'headers' => [ 'Content-Type' => 'application/ld+json', ], diff --git a/tests/Api/PlaylistsTest.php b/tests/Api/PlaylistsTest.php index 63014872..d5b415ac 100644 --- a/tests/Api/PlaylistsTest.php +++ b/tests/Api/PlaylistsTest.php @@ -12,21 +12,21 @@ class PlaylistsTest extends AbstractBaseApiTestCase { public function testGetCollection(): void { - $response = $this->getAuthenticatedClient()->request('GET', '/v1/playlists?itemsPerPage=5', ['headers' => ['Content-Type' => 'application/ld+json']]); + $response = $this->getAuthenticatedClient()->request('GET', '/v2/playlists?itemsPerPage=5', ['headers' => ['Content-Type' => 'application/ld+json']]); $this->assertResponseIsSuccessful(); $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); $this->assertJsonContains([ '@context' => '/contexts/Playlist', - '@id' => '/v1/playlists', + '@id' => '/v2/playlists', '@type' => 'hydra:Collection', 'hydra:totalItems' => 11, 'hydra:view' => [ - '@id' => '/v1/playlists?itemsPerPage=5&page=1', + '@id' => '/v2/playlists?itemsPerPage=5&page=1', '@type' => 'hydra:PartialCollectionView', - 'hydra:first' => '/v1/playlists?itemsPerPage=5&page=1', - 'hydra:last' => '/v1/playlists?itemsPerPage=5&page=3', - 'hydra:next' => '/v1/playlists?itemsPerPage=5&page=2', + 'hydra:first' => '/v2/playlists?itemsPerPage=5&page=1', + 'hydra:last' => '/v2/playlists?itemsPerPage=5&page=3', + 'hydra:next' => '/v2/playlists?itemsPerPage=5&page=2', ], ]); @@ -35,13 +35,13 @@ public function testGetCollection(): void public function testGetCampaigns(): void { - $this->getAuthenticatedClient()->request('GET', '/v1/playlists?itemsPerPage=5&isCampaign=true', ['headers' => ['Content-Type' => 'application/ld+json']]); + $this->getAuthenticatedClient()->request('GET', '/v2/playlists?itemsPerPage=5&isCampaign=true', ['headers' => ['Content-Type' => 'application/ld+json']]); $this->assertResponseIsSuccessful(); $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); $this->assertJsonContains([ '@context' => '/contexts/Playlist', - '@id' => '/v1/playlists', + '@id' => '/v2/playlists', '@type' => 'hydra:Collection', ]); } @@ -75,7 +75,7 @@ public function testGetItem(): void public function testCreatePlaylist(): void { - $response = $this->getAuthenticatedClient()->request('POST', '/v1/playlists', [ + $response = $this->getAuthenticatedClient()->request('POST', '/v2/playlists', [ 'json' => [ 'title' => 'Test playlist', 'description' => 'This is a test playlist', @@ -136,7 +136,7 @@ public function testCreatePlaylist(): void ]); $this->assertMatchesRegularExpression('@^/v\d/\w+/([A-Za-z0-9]{26})$@', $response->toArray()['@id']); - $response = $this->getAuthenticatedClient()->request('POST', '/v1/playlists', [ + $response = $this->getAuthenticatedClient()->request('POST', '/v2/playlists', [ 'json' => [ 'title' => 'Test playlist', 'description' => 'This is a test playlist', @@ -220,7 +220,7 @@ public function testCreatePlaylist(): void public function testCreateUnpublishedPlaylist(): void { - $this->getAuthenticatedClient()->request('POST', '/v1/playlists', [ + $this->getAuthenticatedClient()->request('POST', '/v2/playlists', [ 'json' => [ 'title' => 'Test playlist', 'description' => 'This is a test playlist', @@ -259,7 +259,7 @@ public function testCreateUnpublishedPlaylist(): void public function testCreateInvalidPlaylist(): void { - $this->getAuthenticatedClient()->request('POST', '/v1/playlists', [ + $this->getAuthenticatedClient()->request('POST', '/v2/playlists', [ 'json' => [ 'title' => 123_456_789, ], @@ -281,7 +281,7 @@ public function testCreateInvalidPlaylist(): void public function testCreateInvalidPlaylistTime(): void { - $this->getAuthenticatedClient()->request('POST', '/v1/playlists', [ + $this->getAuthenticatedClient()->request('POST', '/v2/playlists', [ 'json' => [ 'published' => [ 'from' => '2021-09-201T17:00:01.000Z', @@ -377,26 +377,26 @@ public function testGetScreensList(): void $iri = $this->findIriBy(Playlist::class, ['tenant' => $this->tenant]); $ulid = $this->iriHelperUtils->getUlidFromIRI($iri); - $client->request('GET', '/v1/campaigns/'.$ulid.'/screens', ['headers' => ['Content-Type' => 'application/ld+json']]); + $client->request('GET', '/v2/campaigns/'.$ulid.'/screens', ['headers' => ['Content-Type' => 'application/ld+json']]); $this->assertResponseIsSuccessful(); $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); $this->assertJsonContains([ '@context' => '/contexts/ScreenCampaign', - '@id' => '/v1/campaigns/'.$ulid.'/screens', + '@id' => '/v2/campaigns/'.$ulid.'/screens', '@type' => 'hydra:Collection', ]); } public function testSharedPlaylists(): void { - $response = $this->getAuthenticatedClient()->request('GET', '/v1/playlists?itemsPerPage=20', ['headers' => ['Content-Type' => 'application/ld+json']]); + $response = $this->getAuthenticatedClient()->request('GET', '/v2/playlists?itemsPerPage=20', ['headers' => ['Content-Type' => 'application/ld+json']]); $this->assertResponseIsSuccessful(); $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); $this->assertJsonContains([ '@context' => '/contexts/Playlist', - '@id' => '/v1/playlists', + '@id' => '/v2/playlists', '@type' => 'hydra:Collection', 'hydra:totalItems' => 13, ]); diff --git a/tests/Api/ScreenCampaignTest.php b/tests/Api/ScreenCampaignTest.php index 67a9f545..64f33731 100644 --- a/tests/Api/ScreenCampaignTest.php +++ b/tests/Api/ScreenCampaignTest.php @@ -25,7 +25,7 @@ public function testLinkPlaylistToScreen(): void $iri = $this->findIriBy(Screen::class, ['tenant' => $this->tenant]); $screenUlid2 = $this->iriHelperUtils->getUlidFromIRI($iri); - $client->request('PUT', '/v1/screens/'.$playlistUlid.'/campaigns', [ + $client->request('PUT', '/v2/screens/'.$playlistUlid.'/campaigns', [ 'json' => [ (object) [ 'screen' => $screenUlid1, @@ -58,13 +58,13 @@ public function testGetSlidesList(): void $iri = $this->findIriBy(Screen::class, ['tenant' => $this->tenant]); $ulid = $this->iriHelperUtils->getUlidFromIRI($iri); - $client->request('GET', '/v1/screens/'.$ulid.'/campaigns?page=1&itemsPerPage=10', ['headers' => ['Content-Type' => 'application/ld+json']]); + $client->request('GET', '/v2/screens/'.$ulid.'/campaigns?page=1&itemsPerPage=10', ['headers' => ['Content-Type' => 'application/ld+json']]); $this->assertResponseIsSuccessful(); $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); $this->assertJsonContains([ '@context' => '/contexts/ScreenCampaign', - '@id' => '/v1/screens/'.$ulid.'/campaigns', + '@id' => '/v2/screens/'.$ulid.'/campaigns', '@type' => 'hydra:Collection', ]); } @@ -81,7 +81,7 @@ public function testUnlinkPlaylist(): void $iri = $this->findIriBy(Screen::class, ['tenant' => $this->tenant]); $screenUlid2 = $this->iriHelperUtils->getUlidFromIRI($iri); - $client->request('PUT', '/v1/screens/'.$playlistUlid.'/campaigns', [ + $client->request('PUT', '/v2/screens/'.$playlistUlid.'/campaigns', [ 'json' => [ (object) [ 'screen' => $screenUlid1, @@ -96,13 +96,13 @@ public function testUnlinkPlaylist(): void ]); $this->assertResponseStatusCodeSame(201); - $client->request('DELETE', '/v1/screens/'.$screenUlid1.'/campaigns/'.$playlistUlid, [ + $client->request('DELETE', '/v2/screens/'.$screenUlid1.'/campaigns/'.$playlistUlid, [ 'headers' => [ 'Content-Type' => 'application/ld+json', ], ]); $this->assertResponseStatusCodeSame(204); - $client->request('DELETE', '/v1/screens/'.$screenUlid2.'/campaigns/'.$playlistUlid, [ + $client->request('DELETE', '/v2/screens/'.$screenUlid2.'/campaigns/'.$playlistUlid, [ 'headers' => [ 'Content-Type' => 'application/ld+json', ], diff --git a/tests/Api/ScreenGroupCampaignTest.php b/tests/Api/ScreenGroupCampaignTest.php index f7597bc0..8168f1ee 100644 --- a/tests/Api/ScreenGroupCampaignTest.php +++ b/tests/Api/ScreenGroupCampaignTest.php @@ -25,7 +25,7 @@ public function testLinkPlaylistToScreenGroup(): void $iri = $this->findIriBy(ScreenGroup::class, ['tenant' => $this->tenant]); $screenGroupUlid2 = $this->iriHelperUtils->getUlidFromIRI($iri); - $client->request('PUT', '/v1/screen-groups/'.$playlistUlid.'/campaigns', [ + $client->request('PUT', '/v2/screen-groups/'.$playlistUlid.'/campaigns', [ 'json' => [ (object) [ 'screengroup' => $screenGroupUlid1, @@ -58,13 +58,13 @@ public function testGetSlidesList(): void $iri = $this->findIriBy(ScreenGroup::class, ['tenant' => $this->tenant]); $ulid = $this->iriHelperUtils->getUlidFromIRI($iri); - $client->request('GET', '/v1/screen-groups/'.$ulid.'/campaigns?page=1&itemsPerPage=10', ['headers' => ['Content-Type' => 'application/ld+json']]); + $client->request('GET', '/v2/screen-groups/'.$ulid.'/campaigns?page=1&itemsPerPage=10', ['headers' => ['Content-Type' => 'application/ld+json']]); $this->assertResponseIsSuccessful(); $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); $this->assertJsonContains([ '@context' => '/contexts/ScreenGroupCampaign', - '@id' => '/v1/screen-groups/'.$ulid.'/campaigns', + '@id' => '/v2/screen-groups/'.$ulid.'/campaigns', '@type' => 'hydra:Collection', ]); } @@ -81,7 +81,7 @@ public function testUnlinkPlaylist(): void $iri = $this->findIriBy(ScreenGroup::class, ['tenant' => $this->tenant]); $screenGroupUlid2 = $this->iriHelperUtils->getUlidFromIRI($iri); - $client->request('PUT', '/v1/screen-groups/'.$playlistUlid.'/campaigns', [ + $client->request('PUT', '/v2/screen-groups/'.$playlistUlid.'/campaigns', [ 'json' => [ (object) [ 'screengroup' => $screenGroupUlid1, @@ -96,13 +96,13 @@ public function testUnlinkPlaylist(): void ]); $this->assertResponseStatusCodeSame(201); - $client->request('DELETE', '/v1/screen-groups/'.$screenGroupUlid1.'/campaigns/'.$playlistUlid, [ + $client->request('DELETE', '/v2/screen-groups/'.$screenGroupUlid1.'/campaigns/'.$playlistUlid, [ 'headers' => [ 'Content-Type' => 'application/ld+json', ], ]); $this->assertResponseStatusCodeSame(204); - $client->request('DELETE', '/v1/screen-groups/'.$screenGroupUlid2.'/campaigns/'.$playlistUlid, [ + $client->request('DELETE', '/v2/screen-groups/'.$screenGroupUlid2.'/campaigns/'.$playlistUlid, [ 'headers' => [ 'Content-Type' => 'application/ld+json', ], diff --git a/tests/Api/ScreenGroupsTest.php b/tests/Api/ScreenGroupsTest.php index 7688f1ee..4046955b 100644 --- a/tests/Api/ScreenGroupsTest.php +++ b/tests/Api/ScreenGroupsTest.php @@ -12,21 +12,21 @@ class ScreenGroupsTest extends AbstractBaseApiTestCase { public function testGetCollection(): void { - $response = $this->getAuthenticatedClient('ROLE_SCREEN')->request('GET', '/v1/screen-groups?itemsPerPage=2', ['headers' => ['Content-Type' => 'application/ld+json']]); + $response = $this->getAuthenticatedClient('ROLE_SCREEN')->request('GET', '/v2/screen-groups?itemsPerPage=2', ['headers' => ['Content-Type' => 'application/ld+json']]); $this->assertResponseIsSuccessful(); $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); $this->assertJsonContains([ '@context' => '/contexts/ScreenGroup', - '@id' => '/v1/screen-groups', + '@id' => '/v2/screen-groups', '@type' => 'hydra:Collection', 'hydra:totalItems' => 20, 'hydra:view' => [ - '@id' => '/v1/screen-groups?itemsPerPage=2&page=1', + '@id' => '/v2/screen-groups?itemsPerPage=2&page=1', '@type' => 'hydra:PartialCollectionView', - 'hydra:first' => '/v1/screen-groups?itemsPerPage=2&page=1', - 'hydra:last' => '/v1/screen-groups?itemsPerPage=2&page=10', - 'hydra:next' => '/v1/screen-groups?itemsPerPage=2&page=2', + 'hydra:first' => '/v2/screen-groups?itemsPerPage=2&page=1', + 'hydra:last' => '/v2/screen-groups?itemsPerPage=2&page=10', + 'hydra:next' => '/v2/screen-groups?itemsPerPage=2&page=2', ], ]); @@ -52,7 +52,7 @@ public function testGetItem(): void public function testCreateScreenGroup(): void { - $response = $this->getAuthenticatedClient('ROLE_ADMIN')->request('POST', '/v1/screen-groups', [ + $response = $this->getAuthenticatedClient('ROLE_ADMIN')->request('POST', '/v2/screen-groups', [ 'json' => [ 'title' => 'Test groups', 'description' => 'This is a test screen group', @@ -78,7 +78,7 @@ public function testCreateScreenGroup(): void public function testCreateInvalidScreenGroup(): void { - $this->getAuthenticatedClient('ROLE_ADMIN')->request('POST', '/v1/screen-groups', [ + $this->getAuthenticatedClient('ROLE_ADMIN')->request('POST', '/v2/screen-groups', [ 'json' => [ 'title' => 123_456_789, ], @@ -142,16 +142,16 @@ public function testGetScreenGroupsScreenRelations(): void // A random ULID. $ulid = '01FKZZ3HHK2ESG3PMV2KXTX5QY'; - $client->request('GET', '/v1/screens/'.$ulid.'/screen-groups?itemsPerPage=2&page=1', ['headers' => ['Content-Type' => 'application/ld+json']]); + $client->request('GET', '/v2/screens/'.$ulid.'/screen-groups?itemsPerPage=2&page=1', ['headers' => ['Content-Type' => 'application/ld+json']]); $this->assertResponseIsSuccessful(); $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); $this->assertJsonContains([ '@context' => '/contexts/ScreenGroup', - '@id' => '/v1/screens/'.$ulid.'/screen-groups', + '@id' => '/v2/screens/'.$ulid.'/screen-groups', '@type' => 'hydra:Collection', 'hydra:view' => [ - '@id' => '/v1/screens/'.$ulid.'/screen-groups?itemsPerPage=2', + '@id' => '/v2/screens/'.$ulid.'/screen-groups?itemsPerPage=2', '@type' => 'hydra:PartialCollectionView', ], ]); @@ -169,7 +169,7 @@ public function testCreateScreenGroupsScreenRelations(): void $iri = $this->findIriBy(ScreenGroup::class, ['tenant' => $this->tenant]); $screenGroupUlid = $this->iriHelperUtils->getUlidFromIRI($iri); - $client->request('PUT', '/v1/screens/'.$screenUlid.'/screen-groups', [ + $client->request('PUT', '/v2/screens/'.$screenUlid.'/screen-groups', [ 'json' => [ $screenGroupUlid, ], @@ -200,7 +200,7 @@ public function testDeleteScreenGroupsScreenRelations(): void $iri = $this->findIriBy(ScreenGroup::class, ['tenant' => $this->tenant]); $screenGroupUlid = $this->iriHelperUtils->getUlidFromIRI($iri); - $client->request('PUT', '/v1/screens/'.$screenUlid.'/screen-groups', [ + $client->request('PUT', '/v2/screens/'.$screenUlid.'/screen-groups', [ 'json' => [ $screenGroupUlid, ], @@ -212,7 +212,7 @@ public function testDeleteScreenGroupsScreenRelations(): void $this->assertResponseStatusCodeSame(201); $this->assertResponseHeaderSame('content-type', 'application/json'); - $client->request('DELETE', '/v1/screens/'.$screenUlid.'/screen-groups/'.$screenGroupUlid, [ + $client->request('DELETE', '/v2/screens/'.$screenUlid.'/screen-groups/'.$screenGroupUlid, [ 'headers' => [ 'Content-Type' => 'application/ld+json', ], diff --git a/tests/Api/ScreensTest.php b/tests/Api/ScreensTest.php index 93a4068d..59ec242d 100644 --- a/tests/Api/ScreensTest.php +++ b/tests/Api/ScreensTest.php @@ -12,21 +12,21 @@ class ScreensTest extends AbstractBaseApiTestCase { public function testGetCollection(): void { - $response = $this->getAuthenticatedClient('ROLE_ADMIN')->request('GET', '/v1/screens?itemsPerPage=5', ['headers' => ['Content-Type' => 'application/ld+json']]); + $response = $this->getAuthenticatedClient('ROLE_ADMIN')->request('GET', '/v2/screens?itemsPerPage=5', ['headers' => ['Content-Type' => 'application/ld+json']]); $this->assertResponseIsSuccessful(); $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); $this->assertJsonContains([ '@context' => '/contexts/Screen', - '@id' => '/v1/screens', + '@id' => '/v2/screens', '@type' => 'hydra:Collection', 'hydra:totalItems' => 10, 'hydra:view' => [ - '@id' => '/v1/screens?itemsPerPage=5&page=1', + '@id' => '/v2/screens?itemsPerPage=5&page=1', '@type' => 'hydra:PartialCollectionView', - 'hydra:first' => '/v1/screens?itemsPerPage=5&page=1', - 'hydra:last' => '/v1/screens?itemsPerPage=5&page=2', - 'hydra:next' => '/v1/screens?itemsPerPage=5&page=2', + 'hydra:first' => '/v2/screens?itemsPerPage=5&page=1', + 'hydra:last' => '/v2/screens?itemsPerPage=5&page=2', + 'hydra:next' => '/v2/screens?itemsPerPage=5&page=2', ], ]); @@ -73,7 +73,7 @@ public function testCreateScreen(): void $layoutIri = $this->findIriBy(ScreenLayout::class, []); - $response = $client->request('POST', '/v1/screens', [ + $response = $client->request('POST', '/v2/screens', [ 'json' => [ 'title' => 'Test screen 42', 'description' => 'This is a test screen', @@ -126,7 +126,7 @@ public function testCreateScreen(): void public function testCreateInvalidScreen(): void { - $this->getAuthenticatedClient('ROLE_ADMIN')->request('POST', '/v1/screens', [ + $this->getAuthenticatedClient('ROLE_ADMIN')->request('POST', '/v2/screens', [ 'json' => [ 'title' => 123_456_789, ], diff --git a/tests/Api/SetTenantTest.php b/tests/Api/SetTenantTest.php index 3d542ca0..00e2bcc7 100644 --- a/tests/Api/SetTenantTest.php +++ b/tests/Api/SetTenantTest.php @@ -19,7 +19,7 @@ public function testTenantSetOnCreate(): void $themeIri = $this->findIriBy(Theme::class, ['tenant' => $this->tenant]); $feedSource = $this->findIriBy(FeedSource::class, ['tenant' => $this->tenant]); - $response = $client->request('POST', '/v1/slides', [ + $response = $client->request('POST', '/v2/slides', [ 'json' => [ 'title' => 'Test slide', 'description' => 'This is a test slide', diff --git a/tests/Api/SlidesTest.php b/tests/Api/SlidesTest.php index cab6a661..d1996a8f 100644 --- a/tests/Api/SlidesTest.php +++ b/tests/Api/SlidesTest.php @@ -14,20 +14,20 @@ class SlidesTest extends AbstractBaseApiTestCase { public function testGetCollection(): void { - $response = $this->getAuthenticatedClient()->request('GET', '/v1/slides?itemsPerPage=10', ['headers' => ['Content-Type' => 'application/ld+json']]); + $response = $this->getAuthenticatedClient()->request('GET', '/v2/slides?itemsPerPage=10', ['headers' => ['Content-Type' => 'application/ld+json']]); $this->assertResponseIsSuccessful(); $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); $this->assertJsonContains([ '@context' => '/contexts/Slide', - '@id' => '/v1/slides', + '@id' => '/v2/slides', '@type' => 'hydra:Collection', 'hydra:totalItems' => 60, 'hydra:view' => [ - '@id' => '/v1/slides?itemsPerPage=10&page=1', + '@id' => '/v2/slides?itemsPerPage=10&page=1', '@type' => 'hydra:PartialCollectionView', - 'hydra:first' => '/v1/slides?itemsPerPage=10&page=1', - 'hydra:last' => '/v1/slides?itemsPerPage=10&page=6', + 'hydra:first' => '/v2/slides?itemsPerPage=10&page=1', + 'hydra:last' => '/v2/slides?itemsPerPage=10&page=6', ], ]); @@ -61,7 +61,7 @@ public function testCreateSlide(): void $themeIri = $this->findIriBy(Theme::class, ['tenant' => $this->tenant]); $feedSource = $this->findIriBy(FeedSource::class, ['tenant' => $this->tenant]); - $response = $client->request('POST', '/v1/slides', [ + $response = $client->request('POST', '/v2/slides', [ 'json' => [ 'title' => 'Test slide', 'description' => 'This is a test slide', @@ -137,7 +137,7 @@ public function testCreateUnpublishedSlide(): void $templateIri = $this->findIriBy(Template::class, []); $themeIri = $this->findIriBy(Theme::class, ['tenant' => $this->tenant]); - $response = $client->request('POST', '/v1/slides', [ + $response = $client->request('POST', '/v2/slides', [ 'json' => [ 'title' => 'Test slide', 'description' => 'This is a test slide', @@ -176,7 +176,7 @@ public function testCreateUnpublishedSlide(): void public function testCreateInvalidSlide(): void { - $this->getAuthenticatedClient()->request('POST', '/v1/slides', [ + $this->getAuthenticatedClient()->request('POST', '/v2/slides', [ 'json' => [ 'title' => 123_456_789, ], @@ -198,7 +198,7 @@ public function testCreateInvalidSlide(): void public function testCreateInvalidSlideTime(): void { - $this->getAuthenticatedClient()->request('POST', '/v1/slides', [ + $this->getAuthenticatedClient()->request('POST', '/v2/slides', [ 'json' => [ 'published' => [ 'from' => '2021-09-20T17:00:01.000Z', @@ -278,7 +278,7 @@ public function testDeleteSlide(): void $client = $this->getAuthenticatedClient(); $iri = $this->findIriBy(Template::class, []); - $response = $client->request('POST', '/v1/slides', [ + $response = $client->request('POST', '/v2/slides', [ 'json' => [ 'title' => 'Test slide', 'description' => 'This is a test slide', diff --git a/tests/Api/TemplatesTest.php b/tests/Api/TemplatesTest.php index b46fe766..693fbcf1 100644 --- a/tests/Api/TemplatesTest.php +++ b/tests/Api/TemplatesTest.php @@ -11,17 +11,17 @@ class TemplatesTest extends AbstractBaseApiTestCase { public function testGetCollection(): void { - $response = $this->getAuthenticatedClient()->request('GET', '/v1/templates?itemsPerPage=5', ['headers' => ['Content-Type' => 'application/ld+json']]); + $response = $this->getAuthenticatedClient()->request('GET', '/v2/templates?itemsPerPage=5', ['headers' => ['Content-Type' => 'application/ld+json']]); $this->assertResponseIsSuccessful(); $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); $this->assertJsonContains([ '@context' => '/contexts/Template', - '@id' => '/v1/templates', + '@id' => '/v2/templates', '@type' => 'hydra:Collection', 'hydra:totalItems' => 1, 'hydra:view' => [ - '@id' => '/v1/templates?itemsPerPage=5', + '@id' => '/v2/templates?itemsPerPage=5', '@type' => 'hydra:PartialCollectionView', ], ]); diff --git a/tests/Api/ThemesTest.php b/tests/Api/ThemesTest.php index 2260e1d7..4cb8ca9c 100644 --- a/tests/Api/ThemesTest.php +++ b/tests/Api/ThemesTest.php @@ -12,17 +12,17 @@ class ThemesTest extends AbstractBaseApiTestCase { public function testGetCollection(): void { - $response = $this->getAuthenticatedClient('ROLE_SCREEN')->request('GET', '/v1/themes?itemsPerPage=25', ['headers' => ['Content-Type' => 'application/ld+json']]); + $response = $this->getAuthenticatedClient('ROLE_SCREEN')->request('GET', '/v2/themes?itemsPerPage=25', ['headers' => ['Content-Type' => 'application/ld+json']]); $this->assertResponseIsSuccessful(); $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); $this->assertJsonContains([ '@context' => '/contexts/Theme', - '@id' => '/v1/themes', + '@id' => '/v2/themes', '@type' => 'hydra:Collection', 'hydra:totalItems' => 20, 'hydra:view' => [ - '@id' => '/v1/themes?itemsPerPage=25', + '@id' => '/v2/themes?itemsPerPage=25', '@type' => 'hydra:PartialCollectionView', ], ]); @@ -66,7 +66,7 @@ public function testCreateTheme(): void { $client = $this->getAuthenticatedClient('ROLE_ADMIN'); - $response = $client->request('POST', '/v1/themes', [ + $response = $client->request('POST', '/v2/themes', [ 'json' => [ 'title' => 'Test theme', 'description' => 'This is a test theme', @@ -103,7 +103,7 @@ public function testCreateTheme(): void public function testCreateInvalidTheme(): void { - $this->getAuthenticatedClient('ROLE_ADMIN')->request('POST', '/v1/themes', [ + $this->getAuthenticatedClient('ROLE_ADMIN')->request('POST', '/v2/themes', [ 'json' => [ 'title' => 123_456_789, ], @@ -161,7 +161,7 @@ public function testDeleteTheme(): void { $client = $this->getAuthenticatedClient('ROLE_ADMIN'); - $response = $client->request('POST', '/v1/themes', [ + $response = $client->request('POST', '/v2/themes', [ 'json' => [ 'title' => 'Test theme', 'description' => 'This is a test theme', diff --git a/tests/Api/UserTest.php b/tests/Api/UserTest.php index 6c8eb6d2..83c6eb8e 100644 --- a/tests/Api/UserTest.php +++ b/tests/Api/UserTest.php @@ -17,7 +17,7 @@ public function testExternalUserFlow(): void $response1 = $authenticatedClient->request( 'POST', - '/v1/user-activation-codes', + '/v2/user-activation-codes', [ 'body' => json_encode(['displayName' => 'Test Testesen', 'roles' => [Roles::ROLE_EXTERNAL_USER_ADMIN]]), 'headers' => ['Content-Type' => 'application/ld+json'], @@ -30,7 +30,7 @@ public function testExternalUserFlow(): void $response2 = $authenticatedClient->request( 'POST', - '/v1/user-activation-codes', + '/v2/user-activation-codes', [ 'body' => json_encode(['displayName' => 'Test Testesen 2', 'roles' => [Roles::ROLE_EXTERNAL_USER_ADMIN]]), 'headers' => ['Content-Type' => 'application/ld+json'], @@ -41,14 +41,14 @@ public function testExternalUserFlow(): void // Assert that activation codes have been created. $response3 = $authenticatedClient->request( 'GET', - '/v1/user-activation-codes', + '/v2/user-activation-codes', [ 'headers' => ['Content-Type' => 'application/ld+json'], ] ); $this->assertJsonContains([ '@context' => '/contexts/UserActivationCode', - '@id' => '/v1/user-activation-codes', + '@id' => '/v2/user-activation-codes', '@type' => 'hydra:Collection', 'hydra:totalItems' => 2, ]); @@ -62,7 +62,7 @@ public function testExternalUserFlow(): void // Use the activation code. $externalClient->request( 'POST', - '/v1/user-activation-codes/activate', + '/v2/user-activation-codes/activate', [ 'json' => [ 'activationCode' => $code1, @@ -85,14 +85,14 @@ public function testExternalUserFlow(): void $authenticatedClient = $this->getAuthenticatedClient(Roles::ROLE_EXTERNAL_USER_ADMIN); $response4 = $authenticatedClient->request( 'GET', - '/v1/user-activation-codes', + '/v2/user-activation-codes', [ 'headers' => ['Content-Type' => 'application/ld+json'], ] ); $this->assertJsonContains([ '@context' => '/contexts/UserActivationCode', - '@id' => '/v1/user-activation-codes', + '@id' => '/v2/user-activation-codes', '@type' => 'hydra:Collection', 'hydra:totalItems' => 1, ]); @@ -100,7 +100,7 @@ public function testExternalUserFlow(): void $response5 = $authenticatedClient->request( 'POST', - '/v1/user-activation-codes', + '/v2/user-activation-codes', [ 'body' => json_encode(['displayName' => 'Test Testesen 2', 'roles' => [Roles::ROLE_EXTERNAL_USER_ADMIN]]), 'headers' => ['Content-Type' => 'application/ld+json'], @@ -109,18 +109,18 @@ public function testExternalUserFlow(): void $this->assertResponseStatusCodeSame(400); $authenticatedClient = $this->getAuthenticatedClient(Roles::ROLE_EXTERNAL_USER_ADMIN); - $resp = $authenticatedClient->request('GET', '/v1/users'); + $resp = $authenticatedClient->request('GET', '/v2/users'); $this->assertResponseStatusCodeSame(200); $this->assertCount(1, $resp->toArray()['hydra:member']); // Test remove user from tenant, denied for ROLE_EDITOR. $authenticatedClient = $this->getAuthenticatedClient(Roles::ROLE_EDITOR); - $authenticatedClient->request('DELETE', "/v1/users/$userId/remove-from-tenant"); + $authenticatedClient->request('DELETE', "/v2/users/$userId/remove-from-tenant"); $this->assertResponseStatusCodeSame(403); // Test remove user from tenant. $authenticatedClient = $this->getAuthenticatedClient(Roles::ROLE_EXTERNAL_USER_ADMIN); - $authenticatedClient->request('DELETE', "/v1/users/$userId/remove-from-tenant"); + $authenticatedClient->request('DELETE', "/v2/users/$userId/remove-from-tenant"); $this->assertResponseStatusCodeSame(204); $this->getAuthenticatedClientForExternalUser(); @@ -134,7 +134,7 @@ public function testExternalUserInvalidCode(): void // Use the activation code. $response1 = $externalClient->request( 'POST', - '/v1/user-activation-codes/activate', + '/v2/user-activation-codes/activate', [ 'json' => [ 'activationCode' => 'CODEDOESNOTEXIST', @@ -148,34 +148,34 @@ public function testExternalUserInvalidCode(): void public function testAccess(): void { $authenticatedClient = $this->getAuthenticatedClient(Roles::ROLE_EDITOR); - $authenticatedClient->request('GET', '/v1/users'); + $authenticatedClient->request('GET', '/v2/users'); $this->assertResponseStatusCodeSame(403); $authenticatedClient = $this->getAuthenticatedClient(Roles::ROLE_USER); - $authenticatedClient->request('GET', '/v1/users'); + $authenticatedClient->request('GET', '/v2/users'); $this->assertResponseStatusCodeSame(403); $authenticatedClient = $this->getAuthenticatedClient(Roles::ROLE_EXTERNAL_USER); - $authenticatedClient->request('GET', '/v1/users'); + $authenticatedClient->request('GET', '/v2/users'); $this->assertResponseStatusCodeSame(403); $authenticatedClient = $this->getAuthenticatedClient(Roles::ROLE_EXTERNAL_USER_ADMIN); - $resp = $authenticatedClient->request('GET', '/v1/users'); + $resp = $authenticatedClient->request('GET', '/v2/users'); $this->assertResponseStatusCodeSame(200); $this->assertCount(0, $resp->toArray()['hydra:member']); $authenticatedClient = $this->getAuthenticatedClient(Roles::ROLE_ADMIN); - $resp = $authenticatedClient->request('GET', '/v1/users'); + $resp = $authenticatedClient->request('GET', '/v2/users'); $this->assertResponseStatusCodeSame(200); $this->assertCount(0, $resp->toArray()['hydra:member']); $authenticatedClient = $this->getAuthenticatedClient(Roles::ROLE_SUPER_ADMIN); - $resp = $authenticatedClient->request('GET', '/v1/users'); + $resp = $authenticatedClient->request('GET', '/v2/users'); $this->assertResponseStatusCodeSame(200); $this->assertCount(0, $resp->toArray()['hydra:member']); $authenticatedClient = $this->getAuthenticatedClient(Roles::ROLE_USER_ADMIN); - $resp = $authenticatedClient->request('GET', '/v1/users'); + $resp = $authenticatedClient->request('GET', '/v2/users'); $this->assertResponseStatusCodeSame(200); $this->assertCount(3, $resp->toArray()['hydra:member']); @@ -208,7 +208,7 @@ public function testRefresh() $response1 = $authenticatedClient->request( 'POST', - '/v1/user-activation-codes', + '/v2/user-activation-codes', [ 'body' => json_encode(['displayName' => 'Test Testesen 4', 'roles' => [Roles::ROLE_EXTERNAL_USER_ADMIN]]), 'headers' => ['Content-Type' => 'application/ld+json'], @@ -221,7 +221,7 @@ public function testRefresh() $authenticatedClient->request( 'POST', - '/v1/user-activation-codes/refresh', + '/v2/user-activation-codes/refresh', [ 'body' => json_encode(['activationCode' => 'wrong']), 'headers' => ['Content-Type' => 'application/ld+json'], @@ -232,7 +232,7 @@ public function testRefresh() $authenticatedClient->request( 'POST', - '/v1/user-activation-codes/refresh', + '/v2/user-activation-codes/refresh', [ 'body' => json_encode(['activationCode' => $code1], JSON_THROW_ON_ERROR), 'headers' => ['Content-Type' => 'application/ld+json'], diff --git a/tests/Utils/IriHelperUtilsTest.php b/tests/Utils/IriHelperUtilsTest.php index 9704d5e7..99e20767 100644 --- a/tests/Utils/IriHelperUtilsTest.php +++ b/tests/Utils/IriHelperUtilsTest.php @@ -20,14 +20,14 @@ protected function setUp(): void public function testGetUlidFromIRI(): void { - $this->assertEquals('01FGK86DW4RWJ8JFCJC62ZHX69', $this->utils->getUlidFromIRI('/v1/layouts/01FGK86DW4RWJ8JFCJC62ZHX69')); - $this->assertEquals('01FGK86DW4RWJ8JFCJC62ZHX5Z', $this->utils->getUlidFromIRI('/v1/layouts/regions/01FGK86DW4RWJ8JFCJC62ZHX5Z')); + $this->assertEquals('01FGK86DW4RWJ8JFCJC62ZHX69', $this->utils->getUlidFromIRI('/v2/layouts/01FGK86DW4RWJ8JFCJC62ZHX69')); + $this->assertEquals('01FGK86DW4RWJ8JFCJC62ZHX5Z', $this->utils->getUlidFromIRI('/v2/layouts/regions/01FGK86DW4RWJ8JFCJC62ZHX5Z')); } public function testInvalidPathGetUlidFromIRI(): void { $this->expectException(InvalidArgumentException::class); - $this->utils->getUlidFromIRI('/v1/layou2ts/01FGK86DW4RWJ8JFCJC62ZHX69'); + $this->utils->getUlidFromIRI('/v2/layou2ts/01FGK86DW4RWJ8JFCJC62ZHX69'); } public function testInvalidUlidGetUlidFromIRI(): void @@ -35,6 +35,6 @@ public function testInvalidUlidGetUlidFromIRI(): void $this->expectException(InvalidArgumentException::class); // First char is bigger than 7. - $this->utils->getUlidFromIRI('/v1/layouts/81FGK86DW4RWQ8JFCJC62ZHX69'); + $this->utils->getUlidFromIRI('/v2/layouts/81FGK86DW4RWQ8JFCJC62ZHX69'); } } diff --git a/tests/Utils/PathUtilsTest.php b/tests/Utils/PathUtilsTest.php index a84808ed..eb344dd0 100644 --- a/tests/Utils/PathUtilsTest.php +++ b/tests/Utils/PathUtilsTest.php @@ -16,14 +16,14 @@ protected function setUp(): void public function testPathPrefix(): void { - $utils = new PathUtils(['route_prefix' => 'v1']); - $this->assertEquals('/v1/', $utils->getApiPlatformPathPrefix()); + $utils = new PathUtils(['route_prefix' => 'v2']); + $this->assertEquals('/v2/', $utils->getApiPlatformPathPrefix()); - $utils = new PathUtils(['route_prefix' => '/v1']); - $this->assertEquals('/v1/', $utils->getApiPlatformPathPrefix()); + $utils = new PathUtils(['route_prefix' => '/v2']); + $this->assertEquals('/v2/', $utils->getApiPlatformPathPrefix()); - $utils = new PathUtils(['route_prefix' => '/v1/test']); - $this->assertEquals('/v1/test/', $utils->getApiPlatformPathPrefix()); + $utils = new PathUtils(['route_prefix' => '/v2/test']); + $this->assertEquals('/v2/test/', $utils->getApiPlatformPathPrefix()); $utils = new PathUtils([]); $this->assertEquals('/', $utils->getApiPlatformPathPrefix());