artifactValidator

Assemble and validate application artifacts using JSON schema

Contents

Module Members

Types

Module Members

create()

Create an artifact validator instance.

Example:

const validator = laxarTooling.artifactValidator.create();
Returns
Type Description
ArtifactValidator the created artifact validator

validateArtifacts( artifacts )

Validate artifacts returned by the ArtifactCollector.

Example:

collector.collectArtifacts( { flows: 'main' } )
   .then( validator.validateArtifacts );
Parameters
Property Type Description
artifacts Object artifacts returned by ArtifactCollector#collectArtifacts
Returns
Type Description
Promise.<Object> the validated artifacts

validateFlows( flows, validators )

Parameters
Property Type Description
flows Array.<Object> the flow artifacts to validate
validators Object validators created by #buildValidators
Returns
Type Description
Promise.<Array> the validated flows

validatePages( pages, validators, flows, widgets, layouts )

Parameters
Property Type Description
pages Array.<Object> the page artifacts to validate
validators Object validators created by #buildValidators
flows Array.<Object> the flows telling us which pages are entry-pages
widgets Array.<Object> the widgets, used to perform name lookups
layouts Array.<Object> the layouts, used to perform name lookups
Returns
Type Description
Promise.<Array> the validated pages

validateWidgets( widgets, validators )

Parameters
Property Type Description
widgets Array.<Object> the widget artifacts to validate
validators Object validators created by #buildValidators
Returns
Type Description
Promise.<Array> the validated widgets

buildValidators()

Create validation functions from the given artifacts. Compiles all schemas listed in the artifacts object including schema descriptions in widget descriptors and page composition definitions.

Returns
Type Description
Object an object containg validation functions.

Types

ArtifactValidator