Commit graph

82 commits

Author SHA1 Message Date
Jeremy Benoist 6aca334d53
Move to controller as a service
Mostly using autowiring to inject deps.
The only tricky part was for import because all producer use the same class and have a different alias. So we must write them down in the service definition, autowiring doesn't work in that case.

Usually:
- if a controller has a constructor, it means injected services are at least re-used once in actions
- otherwise, service are injected per action
2022-12-19 10:38:08 +01:00
Jeremy Benoist b7dba18cb2
Cleanup 2022-11-23 15:51:33 +01:00
Jeremy Benoist 27e788d0be
Re-create all API routes 2022-11-23 12:44:55 +01:00
Casper Meijn 470a8575c0 Update to nelmio/api-doc 3.0
Convert ApiDoc to Swagger
2022-11-16 16:10:33 +01:00
Yassine Guedidi eb43c78720 Use FQCN instead of service alias 2022-09-01 09:07:19 +02:00
Yassine Guedidi 5a55a64fee Use fosuser_registration directly instead of wallabag_user.registration_enabled 2022-08-15 17:23:16 +02:00
Jeremy Benoist 52e8d93248
Fix some Scrutinizer issues 2019-05-29 12:50:44 +02:00
Jeremy Benoist 019e1acc49
Factorize sendResponse between Api controllers
And run newer cs fixer
2019-01-22 20:42:25 +01:00
Jeremy Benoist 3bd65991ad
Add a new endpoint to retrieve information from the wallabag instance
Useful for api client which required some information.
We might add more inside them in the future.

The endpoint /api/version should be avoided now as it contains not so much information rather the version.
2019-01-15 10:17:11 +01:00
Jeremy Benoist f40c88eb1f
Jump to Symfony 3.3 & update others deps
Also update tests urls
2017-10-09 16:45:12 +02:00
Jeremy Benoist f808b01692
Add a real configuration for CS-Fixer 2017-07-01 09:52:38 +02: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 900c844861
Exploded WallabagRestController into many controllers
Fix #2503
2016-10-28 14:46:30 +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
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 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
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
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
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
Thomas Citharel e5fb89e5d3 Add since parameter 2016-06-25 21:05:50 +02:00
Yuriy Evdokimov 614a0bfd86 PATCH also clears starred and archived signs 2016-05-18 15:28:49 +05:00
Yuriy Evdokimov 873e380658 Starred and Archived clears if article is already exists 2016-05-18 10:30:33 +05:00
Nicolas Lœuillet 51a15609b3 Set the title via POST /api/entries
Fix #2009
2016-05-02 12:50:42 +02:00