- Allow importing Rich Text from Contentful and transform it to DatoCMS Structured Text
-
Add support for aborting
createUploadPath
,uploadFile
anduploadImage
throughuploadPromise.cancel
-
Add additional
options
argument tocreateUploadPath
,uploadFile
anduploadImage
- Add
options.onProgress
for tracking the upload progress ofcreateUploadPath
,uploadFile
anduploadImage
- Add
options.filename
for renaming files uploaded withcreateUploadPath
,uploadFile
anduploadImage
See the client docs for details and examples
- Add
- Support for the new
appearance
attribute (which deprecates the oldappeareance
)
- Added
loadSchema
onLoader
to improvegatsby-source-datocms
- Fix bug in fallback value for localized fields for
gatsby-source-datocms
compatibility
- Added new attributes to uploads
- Fix in how we build SEO tags
- Fix in getting paginated items
- Introduced option
serializeRequest: false
option to every call. Use it if you want to send a raw JSON API requst to DatoCMS.
deserializeResponse: false
option no longer camelizes response
- Return 1 on
dato dump
errors, to allow better error handling inside CI processes or scripts. - Contentful importer improvements (#35)
- Minor bug fixes
- Big rewrite, faster --watch mode
- If the client receives a 429 error message with no indication of wait time, assume it's 10 seconds
- Fixed two bugs in the WP importer, one about retrieve paginated contend and another with creating the "uncategorized" category that is not returned by the WP APIs.
- Fixed regression where you could no longer access items' item type via .itemType
- Fix Contentful importer. Fixes issues with spaces in model names and with linking assets and items
- Automatically wait in case we get API rate limits
- Support empty responses from server
- add Item .meta method to fetch record meta information
- babel-polyfill no longer gets required
- undefined values are now serialized into JSON payload
Major
- Added entry point for browser
- Removed SiteChangerWatcher from index.js import: SiteChangerWatcher, which uses pusher/node resulted in the crash below when using the package in a browser
- Replaced query-string with node querystring: this also required amending some of the tests, since querystring stringifies objects in different order (ie ?w=96&h96 instead of ?h=96&w=96). Note that query-string was returning an error when building the package with CRA.
Removal of following packages:
- node-fetch since isomorphic-fetch is a wrapper of node-fetch and is already used
- browser-or-node since node already exposes process.browser
- proxy-polyfill: honestly I'm not sure about that one, but I tried consuming the Proxy as a function as indicated here and it failed so I doubt the global import actually make the Proxy Polyfills work at all.
Minor
- eslint-config-airbnb-base is now part of dev dependenvcies as it should
- Added /test in eslint scope for lint:autocorrect task
- Most lint errors are fixed. Some of them are still in there (especially in the /test directory), I didn't want to remove useless variables, I'll let you guys do the cleaning.
- Made API errors more readable
- Allow snake-case keys on every API call (with warnings though)
- Fixed problems with
client.fields.create
method
The big change is that the methods the client makes available are generated at runtime based on the JSON Schema of our CMA. This means any new API endpoint — or changes to existing ones — will instantly be reflected to the client, without the need to upgrade to the latest client version.
We also added a new deserializeResponse
option to every call, that you can use if you want to retrieve the exact payload the DatoCMS returns:
import { SiteClient } from 'datocms-client';
const client = new SiteClient('YOUR-API-KEY');
// `deserializeResponse` is true by default:
const accessToken = client.accessTokens.create({
name: 'New token',
role: '34',
});
// {
// id: "312",
// hardcodedType: null,
// name: "New token",
// token: "XXXX",
// role: "34"
// }
// if `deserializeResponse` is false, this will be the result
const accessToken = client.accessTokens.create(
{ name: 'New token', role: '34' },
{ deserializeResponse: false },
);
// {
// data: {
// type: "access_token",
// id: "312",
// attributes: {
// name: "New token",
// token: "XXXX",
// hardcoded_type: nil
// },
// relationships: {
// role: {
// data: {
// type: "role",
// id: "34"
// }
// }
// }
// }
// }
In our doc pages we also added some examples for the super-handy allPages
option which was already present since v0.3.29:
// if you want to fetch all the pages with just one call:
client.items.all({ "filter[type]" => "44" }, { allPages: true })