Commit graph

104 commits

Author SHA1 Message Date
Jeremy Benoist 5cd0857e3c
Return 304 when content isn't reloaded using the API
Previously it was a 400 but this is more related to a real error.
Using the API user should only know the content got reloaded or not.
If reloaded: 200 otherwise: 304.
2016-11-22 10:45:19 +01:00
Jeremy Benoist 56da73969a
Return an explicit error if reload fail 2016-11-20 16:25:13 +01:00
Jeremy Benoist 70584b42aa
Fixing tests 2016-11-20 15:15:13 +01:00
Jeremy Benoist 0a6f4568b5
Add ability to reload entry from API 2016-11-20 13:08:41 +01:00
Jeremy Benoist 001cc7168a
Cleanup 2016-11-03 18:01:25 +01:00
Jeremy Benoist 864c1dd23a
Fix rest controller merge 2016-11-03 17:29:16 +01:00
Jeremy Benoist 5a619812ca
Merge remote-tracking branch 'origin/master' into 2.2 2016-11-03 16:41:29 +01:00
Jeremy Benoist 7816eb622d
Add entry.saved event to import & rest 2016-11-02 07:10:23 +01:00
Nicolas Lœuillet bc4564a709
Removed useless route 2016-10-28 15:24:58 +02:00
Nicolas Lœuillet 900c844861
Exploded WallabagRestController into many controllers
Fix #2503
2016-10-28 14:46:30 +02:00
Nicolas Lœuillet 23406ca3f1
Added relation between API Client and User
Fix #2062
2016-10-24 21:56:28 +02:00
Jeremy Benoist aa4741091f
Add test on /api/annotations
Fix controller forward in WallabagRestController.
Update PHPDoc so it is sorted the same way as others one
Duplicate all annotations test to use both api & normal way
Also, make annotation tests independent to each other
2016-10-22 12:09:20 +02:00
Jeremy Benoist 3199ec4702
CS 2016-10-22 09:17:01 +02:00
Nicolas Lœuillet d9b7768dca
Added a missing namespace 2016-10-22 09:06:07 +02:00
Thomas Citharel 0c271b9eb0
fix cs and phpdoc 2016-10-22 09:06:07 +02:00
Thomas Citharel b1e92f8c14
cs 2016-10-22 09:06:07 +02:00
Thomas Citharel 1eea248bb0
move code 2016-10-22 09:06:07 +02:00
Thomas Citharel c7935f32d2
cs 2016-10-22 09:06:07 +02:00
Thomas Citharel 351eb8d97e
bring annotations to API 2016-10-22 09:06:07 +02:00
Jeremy Benoist 5960aa1ffc
CS 2016-10-15 18:00:08 +02:00
Jeremy Benoist f1c3f68e90
ApiDoc & Route annotation were conflicted
The generated error was “Unable to guess how to get a Doctrine instance from the request information.”.

I haven’t checked deeper in Doctrine (I know it was coming from the DoctrineParamConverter).

Anyway, I check for FosRest possiblity to add extra format without allowing them for every route (like it was done in the first place).

I finally found a way but it then seems all request goes to the FormatListener of FosRest so I needed to add a custom rules to match all request to be sure we don’t get  a 406 error from FosRest.

Should be ok now …
2016-10-15 16:46:42 +02:00
Jeremy Benoist b1b561da51 Merge pull request #2372 from pmartin/api-get-entry-as-epub
API: ability to export entry in all available format (epub, pdf, etc...)
2016-10-12 14:06:33 +02:00
Nicolas Lœuillet 2a5ff7f554 Merge pull request #2411 from wallabag/fix-entities
Fix entities definition
2016-10-10 08:02:25 +02:00
Jeremy Benoist 8dc4cd0f25
Fix entities definition
As per Doctrine said in the debug tool bar:

- The field Wallabag\ApiBundle\Entity\Client#refreshTokens is on the inverse side of a bi-directional relationship, but the specified mappedBy association on the target-entity Wallabag\ApiBundle\Entity\RefreshToken#client does not contain the required 'inversedBy="refreshTokens"' attribute.

- The field Wallabag\ApiBundle\Entity\Client#accessTokens is on the inverse side of a bi-directional relationship, but the specified mappedBy association on the target-entity Wallabag\ApiBundle\Entity\AccessToken#client does not contain the required 'inversedBy="accessTokens"' attribute.
2016-10-09 20:51:37 +02:00
Jeremy Benoist 28bb48905a
Optimize the way tag list is rendered
Instead of retrieve all informations about entries of a tag to just count them, we’ll count them before with a fastest query.

Also change the layout of the tag list in material design
2016-10-09 18:55:22 +02:00
Nicolas Lœuillet 93a95c09bf Merge pull request #2351 from wallabag/fix-api-client-deletion
Changed relation between API client and refresh token
2016-10-08 13:31:54 +02:00
Nicolas Lœuillet 4ad6f5878a Merge pull request #2393 from wallabag/api-urls-exist
Ability to check multiple urls in API
2016-10-08 13:31:31 +02:00
Jeremy Benoist 3f3a60879e
Add entry export in API
Export isn't available for json & xml because user can use the default
entry endpoint instead.
2016-10-08 12:59:19 +02:00
Pascal MARTIN 24de866534
API: getEntry can return EPUB 2016-10-08 12:05:41 +02:00
Pascal MARTIN 3d4b0b3064
Routing: epub format is allowed for API 2016-10-08 12:05:40 +02:00
Jeremy Benoist ee32248f43
Ensure access_token are removed
When we remove the client, we should ensure that access_token are also removed.

To ensure that, I created a test that generated an access_token. So when we remove the client, this association should be cascaded and shouldn’t generate an error.

Also I moved some Api related stuff to the ApiBundle (like the developer controler and ClientType form)
2016-10-08 00:05:41 +02:00
Jeremy Benoist ac8cf632bb
Ensure orphan tag are remove in API
When the association between a tag and an entry is removed, if the tag doesn’t have other entries, we can remove it.

Also add more tests for that part and ensure TagControllerTest is isolated from the rest of the test suite (finally!)
2016-10-07 23:31:53 +02:00
Jeremy Benoist f0abc22d09
Ability to check multiple urls in API 2016-10-07 20:37:01 +02:00
Jeremy Benoist 0b174d69d7
Fix typo & add test 2016-10-05 19:30:56 +02:00
Thomas Citharel 5d39243068 Fix exists API call
Boo
2016-10-05 15:28:36 +02:00
Nicolas Lœuillet b0da721a52
Changed relation between API client and refresh token
Fix #2350
2016-10-03 21:39:01 +02:00
Jeremy Benoist c3f8b428dd
Fix parameters in API _links
We forgot to pass them to the factory
2016-10-02 15:41:08 +02:00
Jeremy Benoist 3583cadf6f
CS 2016-10-02 01:43:50 +02:00
Jeremy Benoist 6273fefd5d
Add an exists endpoint in API
It should allow third party to check if an url was already saved by a user
2016-10-01 17:15:28 +02:00
Jeremy Benoist faa86e06ba
Fix tags count in menu
Move enable cache for Tag in the Entity because function `find*` should return result and not a Query
2016-09-25 12:03:49 +02:00
Jeremy Benoist 60faee002c
Re-user JsonResponse
Since Symfony 3.1 we can define the json of a JsonResonse using `->setJson()`
2016-09-08 12:03:38 +02:00
Nicolas Lœuillet 429d86f388
Added tags counter in sidebar (material theme) 2016-09-04 20:53:28 +02:00
Jeremy Benoist a0e1eafc35
Add some tests
Also, retrieve tag from the request instead of the query (which will be the same but it's more easy to test).

Moved down `deleteTagAction` because it conflicted with the new action:

  api_delete_tag => /api/tags/{tag}.{_format}
  api_delete_tags_label => /api/tags/label.{_format}

And finally, throw exception when a tag is not found before removing it.
2016-08-23 07:26:58 +02:00
Thomas Citharel 9bf83f1fb8
CS 2016-08-23 07:26:58 +02:00
Thomas Citharel 4da01f492b
Delete tag or tags by label
Tests not included
2016-08-23 07:26:58 +02:00
Jeremy Benoist e71cef0bb8
Fix typos in field name 2016-08-23 07:26:58 +02:00
Thomas Citharel 119914e65d
added name on client 2016-08-23 07:26:58 +02:00
Thomas Citharel 9c545fe028
Added name on client
- Fix typos in field name
- Added migration for name field in API client table

Manually cherry-picked from PR
https://github.com/wallabag/wallabag/pull/2171
2016-08-22 20:18:27 +02:00
Thomas Citharel 28803f106b Add filter for tags on API 2016-06-29 09:55:57 +02:00
Thomas Citharel e43c78abd9 CS 2016-06-25 23:19:21 +02:00