New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@greenberry/datocms-migration-utils

Package Overview
Dependencies
Maintainers
7
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@greenberry/datocms-migration-utils

A collection of utils to help with the development of DatoCMS migration files

  • 1.0.17
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
7
Created
Source

@greenberry/datocms-migration-utils

A collection of utils to help with the development of DatoCMS migration files.

Installation

yarn add @greenberry/datocms-migration-utils -D

API

Each field creator method need 3 arguments a working DatoCMS SiteClient, field options and the modelId you want to attach the field to.

await createFieldMethod(client, options, modelId);

Field Options

createBoolean
KeyTypeRequired
labelString
apiKeyString
hintString
localizedBoolean
requiredBoolean
createColor
KeyTypeRequired
labelString
apiKeyString
hintString
localizedBoolean
requiredBoolean
presetColors[#000]
enableAlphaBoolean
createCTA
KeyTypeRequired
labelString
apiKeyString
hintString
localizedBoolean
requiredBoolean
createDate
KeyTypeRequired
labelString
apiKeyString
hintString
localizedBoolean
requiredBoolean
dateRange{min: 'ISO-8601', max: 'ISO-8601'}
createDateTime
KeyTypeRequired
labelString
apiKeyString
hintString
localizedBoolean
requiredBoolean
dateRange{min: 'ISO-8601', max: 'ISO-8601'}
createEnum
KeyTypeRequired
labelString
apiKeyString
options[String]
defaultValueString
hintString
localizedBoolean
requiredBoolean
createImage
KeyTypeRequired
labelString
apiKeyString
hintString
localizedBoolean
requiredBoolean
KeyTypeRequired
labelString
apiKeyString
items[ItemType ID]
hintString
localizedBoolean
requiredBoolean
uniqueBoolean
KeyTypeRequired
labelString
apiKeyString
items[ItemType ID]
size{ min: Number, max: Number }
hintString
localizedBoolean
requiredBoolean
createModularContent
KeyTypeRequired
labelString
apiKeyString
blockIds[ItemType ID]
hintString
localizedBoolean
requiredBoolean
createNumber
KeyTypeRequired
labelString
apiKeyString
hintString
localizedBoolean
requiredBoolean
createSEO
KeyTypeRequired
labelString
apiKeyString
hintString
localizedBoolean
createSingleLine
KeyTypeRequired
labelString
apiKeyString
hintString
localizedBoolean
requiredBoolean
headingBoolean
createSlug
KeyTypeRequired
labelString
apiKeyString
titleFieldField
prefixString
hintString
localizedBoolean
requiredBoolean
createTextArea
KeyTypeRequired
labelString
apiKeyString
hintString
localizedBoolean
requiredBoolean
createWysiwyg
KeyTypeRequired
labelString
apiKeyString
hintString
localizedBoolean
requiredBoolean
toolbarArray
updateModularContent
KeyTypeRequired
labelString
apiKeyString
localizedBoolean
hintString
blockIds[ItemType ID]
uploadFile
KeyTypeRequired

Color formatting

DatoCMS only accepts a specific format when filling colors. That is why we added a util to format hex values in a shape acceptable by DatoCMS.

const color = formatColor('#000000');
console.log(color);
// {
//   red: 0,
//   blue: 0,
//   green: 0,
//   alpha: 255,
// }

formatColor also accepts a second argument to specify the alpha of the color, this works in the same way as CSS opacity.

const color = formatColor('#000000', 0.8);
console.log(color);
// {
//   red: 0,
//   blue: 0,
//   green: 0,
//   alpha: 204,
// }

FAQs

Package last updated on 10 Nov 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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