diff options
author | Joas Schilling <coding@schilljs.com> | 2017-04-18 18:29:59 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2017-04-18 18:29:59 +0300 |
commit | 8ae1023e60ca188a12caf5b3abf51261a4332ad7 (patch) | |
tree | e6fd291741ea2a90303e5232e887f38444ce7982 | |
parent | 475ad40e443a1be52fa05134cfabf75d1ac9a2b6 (diff) |
Fix routes
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r-- | appinfo/info.xml | 2 | ||||
-rw-r--r-- | appinfo/routes.php | 4 | ||||
-rw-r--r-- | docs/push-v2.md | 4 | ||||
-rw-r--r-- | tests/Unit/AppInfo/RoutesTest.php | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/appinfo/info.xml b/appinfo/info.xml index 277efd4..3873d18 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -15,7 +15,7 @@ <licence>AGPL</licence> <author>Joas Schilling</author> - <version>1.2.2</version> + <version>2.0.0</version> <types> <logging/> diff --git a/appinfo/routes.php b/appinfo/routes.php index 4f16200..205c353 100644 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -24,7 +24,7 @@ return [ ['name' => 'Endpoint#listNotifications', 'url' => '/api/{apiVersion}/notifications', 'verb' => 'GET', 'requirements' => ['apiVersion' => 'v(1|2)']], ['name' => 'Endpoint#getNotification', 'url' => '/api/{apiVersion}/notifications/{id}', 'verb' => 'GET', 'requirements' => ['apiVersion' => 'v(1|2)', 'id' => '\d+']], ['name' => 'Endpoint#deleteNotification', 'url' => '/api/{apiVersion}/notifications/{id}', 'verb' => 'DELETE', 'requirements' => ['apiVersion' => 'v(1|2)', 'id' => '\d+']], - ['name' => 'Push#registerDevice', 'url' => '/api/v3/push', 'verb' => 'POST'], - ['name' => 'Push#removeDevice', 'url' => '/api/v3/push', 'verb' => 'DELETE'], + ['name' => 'Push#registerDevice', 'url' => '/api/{apiVersion}/push', 'verb' => 'POST', 'requirements' => ['apiVersion' => 'v2']], + ['name' => 'Push#removeDevice', 'url' => '/api/{apiVersion}/push', 'verb' => 'DELETE', 'requirements' => ['apiVersion' => 'v2']], ], ]; diff --git a/docs/push-v2.md b/docs/push-v2.md index e635c22..84aed3e 100644 --- a/docs/push-v2.md +++ b/docs/push-v2.md @@ -39,7 +39,7 @@ In order to find out if notifications support push on the server you can run a r 4. The device then sends the `devicePublicKey`, `PushTokenHash` and `proxyServerUrl` to the Nextcloud server: ``` - POST /ocs/v2.php/apps/notifications/api/v3/push + POST /ocs/v2.php/apps/notifications/api/v2/push { "pushTokenHash": "{{PushTokenHash}}", @@ -97,7 +97,7 @@ When an account is removed from a device, the device should unregister on the se The device should then send a `DELETE` request to the Nextcloud server: ``` -DELETE /ocs/v2.php/apps/notifications/api/v3/push +DELETE /ocs/v2.php/apps/notifications/api/v2/push ``` diff --git a/tests/Unit/AppInfo/RoutesTest.php b/tests/Unit/AppInfo/RoutesTest.php index ccac673..4e58432 100644 --- a/tests/Unit/AppInfo/RoutesTest.php +++ b/tests/Unit/AppInfo/RoutesTest.php @@ -37,6 +37,6 @@ class RoutesTest extends TestCase { $this->assertCount(1, $routes); $this->assertArrayHasKey('ocs', $routes); $this->assertInternalType('array', $routes['ocs']); - $this->assertGreaterThanOrEqual(3, sizeof($routes['ocs'])); + $this->assertCount(5, $routes['ocs']); } } |