1.1.7 • Published 2 years ago

fpo-schemas v1.1.7

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

FPO-Schemas

This is a collections of methods to facilitate json validation for the FPO project.

Installation

npm i fpo-schemas

Usage

const schemas = require('fpo-schemas');

const object = {
  "dashboardTemplateKey": "some-dashboad-title",
  "dashboardDisplayName": "Some Display Name",
  "dashboardLogo": "https://some-url.com.jpeg",
  "sections": [
    {
      "cards": [
        {
          "title": "Some Title",
          "poweredByImg": "https://some-image.png",
          "description": "some description",
          "link_url": "https://some-url",
          "titleColor": "#003E52"
        }
      ],
      "name": "Some name"
    },
    {
      "cards": [
        {
          "title": "Some Title",
          "poweredByImg": "https://some-image.png",
          "description": "some description",
          "link_url": "https://some-url",
          "titleColor": "#003E52"
        }
      ],
      "name": "Some other name"
    }
  ]
}
/// This is a sample object for creating or editing dashboards

To test whether the object is valid json for update values, do the following

const validJson = schema.validateDashboard(event)
 /// returns an object with keys valid and message.
  {
      valid: false,
      message:
        'Invalid Sections JSON, please ensure each card has cards and name and in the cards array each object has the following keys: title, poweredByImg, description, link_url, titleColor',
    }

    or
    {
    valid: true,
    message: 'JSON is valid'
  }
1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago