Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

datocms-client

Package Overview
Dependencies
Maintainers
1
Versions
225
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

datocms-client - npm Package Versions

1
23

0.5.5

Diff

Changelog

Source

0.5.5

  • Fixed problems with client.fields.create method
stefanoverna
published 0.5.4 •

Changelog

Source

0.5.4

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 })
stefanoverna
published 0.5.2 •

stefanoverna
published 0.5.1 •

stefanoverna
published 0.5.0 •

stefanoverna
published 0.4.6 •

stefanoverna
published 0.4.5 •

stefanoverna
published 0.4.4 •

stefanoverna
published 0.4.3 •

stefanoverna
published 0.4.2 •

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc