- Basic support for combining apostrophe-workflow with this module. GET requests now succeed as expected when the
_workflowLocalequery parameter is used to specify the desired locale. Otherwise, as before, you receive content for the default locale only. Note that you can only obtain live content, not draft content. POST, PUT and PATCH requests currently are not fully supported with workflow. Note that there is no issue if the doc type in question is excluded from workflow viaexcludeTypes. It is our intention to provide more complete support for headless workflow over time.
- Various tickets have been opened due to confusion around what happens if you use
includeFieldsorexcludeFieldsand, as a result, you do not include the following fields:type,_id,tags,sluganddocPermissions. This can lead to the unexpected failure of joins, the unexpected absence of the_urlproperty (or a bad value for that property), and the unexpected absence of the_edit: trueproperty. This release fixes this issue by always including these fields in the MongoDB query, but excluding them after the fact in the returned array of results if they are present inexcludeFields. - The current
pageproperty is always included in the response when fetching pieces. - eslint added to the tests, passes the apostrophe eslint config.
- The
PATCHmethod works properly withjoinByOneandjoinByArray. You should send the appropriateidFieldoridsField. If these are not explicitly configured, the names map as follows:_joinNamemaps tojoinNameIdFieldorjoinNameIdsField(note there is no_), depending on whether it is ajoinByOneorjoinByArrayfield. Thanks to Giuseppe Monteleone for flagging the issue. - In certain cases, a crash occurred when attempting to report a 500 error to the browser. Thanks to Giuseppe Monteleone for fixing the issue.
distinctanddistinct-countsquery parameters added. You must also configuresafeDistinct.
Thanks to Michelin for making this work possible via Apostrophe Enterprise Support.
includeFieldsandexcludeFieldsnow work properly for joins. Thanks to Anthony Tarlao.
- You may now specify just certain fields to be fetched with
includeFieldsin your query string, or exclude certain fields withexcludeFields. Thanks tofalkodev.
- You may now exclude a field from the GET method of the API entirely by setting
api: falsein its schema field definition. You may also setapi: 'editPermissionRequired'to restrict access to that field to those who can edit the doc in question. Thanks to Anthony Tarlao. - If you would like to restrict GET access completely to those with edit permissions for the doc in question, you may now set the
getRequiresEditPermissionsub-option ofrestApitotrue. Thanks again to Anthony Tarlao.
- Support for the
PATCHmethod, which allows you to send just the fields you want to change, with support for simple array operators as well. Thanks to Paul Grieselhuber for his support.
- New
restApi.safeFiltersoption (thanks to Marjan Georgiev), and documentation of therestApi.maxPerPageoption.
- Documentation changes only. Clarified that areas must be present in the schema to be inserted or updated via the API.
- Fixed bug impacting the data provided by the
GETroute for pages whenall=1is present. The data was incomplete due to missing query criteria.
- Support for API keys, as a lightweight alternative to bearer tokens for server-to-server communication. These should not be compiled into mobile apps, i.e. anywhere users might be able to obtain them by decompiling, etc.
- Support for pages, both reading and writing.
- Support for fragment rendering, and documentation on how to get fully rendered versions.
Documentation changes only. Gave some simple examples of query parameters that can be used to filter the results.
apostrophe-headless no longer has to be configured before modules it adds APIs to, and it is possible to add APIs to apostrophe-images or apostrophe-files if desired. Thanks to Stephen Walsh for pointing out the issue.
Documentation improvements. No code changes.
Added CORS headers. This resolves any issues you may be having accessing the APIs from webpages served from a different host or port number. All modern and even not-so-modern browsers back to IE8 support this solution.
Initial release.