0.8.0 • Published 2 years ago

@autoinvent/conveyor-schema v0.8.0

Weekly downloads
84
License
BSD-3-Clause
Repository
github
Last release
2 years ago

conveyor-schema

npm version

Conveyor-schema is a helper library for @autoinvent/conveyor. It is required for instantiating a SchemaBuilder object to be passed into conveyor's components.

This library provides is an easy way to traverse the schema used in conveyor's framework.

It contains:

1.) schema getters (so you don't have to traverse the tree structure)

2.) methods for checking mutate-ability (creatable, editable, ect)

3.) schema merge helpers

Installation

yarn add @autoinvent/conveyor-schema

With npm:

npm install --save @autoinvent/conveyor-schema

Usage

Getting Started

Inside your main project, after generating your raw schema JSON, convert the object to a 'SchemaBuilder' type:

import { SchemaBuilder } from '@autoinvent/conveyor-schema'

const schema = new SchemaBuilder(schema)

Now your schema is ready to be passed into any conveyor component

Traversing the Schema

The SchemaBuilder object has methods for easily getting props. You will never have to remember the path to take in order to access attributes.

Furthermore, for schema props which can be a boolean or a function, conveyor-schema evaluates both scenarios and returns the correct value. This is useful for attributes such as 'creatable', 'deletable', and 'editable', which may be associated with a callback.

To see a full list of built-in methods, see the SchemaBuilder API docs.

0.8.0

2 years ago

0.7.2

2 years ago

0.7.1

2 years ago

0.5.0

2 years ago

0.7.0

2 years ago

0.6.1

2 years ago

0.6.0

2 years ago

0.4.3

3 years ago

0.4.1

3 years ago

0.4.2

3 years ago

0.4.0

3 years ago

0.3.0

3 years ago

0.3.1

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.0

4 years ago