パッケージの詳細

@bpmn-io/element-templates-validator

bpmn-io37.3kMIT2.5.0

Validate element templates based on JSON Schema

json-schema, json-schema-validator, element templates, validator

readme

element-templates-validator

CI

Validate element templates based on JSON Schema.

Installation

npm i --save @bpmn-io/element-templates-validator

Usage

Given an example element template:

import { validate } from '@bpmn-io/element-templates-validator';

import sample from './test/fixtures/rpa-broken.json';

const {
  valid,
  errors
} = validate(sample);

if (!valid) {
  console.error('Invalid JSON detected:', errors);
}

This will print detailed information about errors inside the sample:

[
  {
    "keyword": "type",
    "dataPath": "",
    "schemaPath": "#/type",
    "params": {
      "type": "object"
    },
    "message": "must be object",
    "dataPointer": {
      "value": {
        "line": 0,
        "column": 0,
        "pos": 0
      },
      "valueEnd": {
        "line": 177,
        "column": 1,
        "pos": 4825
      }
    }
  }
  ...
]

It's also possible to validate multiple objects at once

import { validateAll } from '@bpmn-io/element-templates-validator';

import samples from './test/fixtures/multiple-errors.json';

const {
  valid,
  results
} = validateAll(samples);

if (!valid) {
  console.error('Invalid JSON objects detected:', results.filter(r => !r.valid));
}

License

MIT

更新履歴

Changelog

All notable changes to element-templates-validator are documented here. We use semantic versioning for releases.

Unreleased

_Note: Yet to be released changes appear here._

2.5.0

  • FEAT: support category (5f28c1f)
  • FEAT: support zeebe:formDefinition (#56)
  • FEAT: support zeebe:calledDecision (#56)
  • FEAT: support bpmn:ScriptTask with zeebe:script and zeebe:taskDefinition (#56)
  • DEPS: update to @camunda/zeebe-element-templates-json-schema@0.24.0

2.4.0

2.3.3

2.3.2

2.3.1

2.3.0

2.2.0

  • FEAT: support engines property for zeebe templates (#146, #152)
  • DEPS: update to @camunda/element-templates-json-schema@0.18.1
  • DEPS: update to @camunda/zeebe-element-templates-json-schema@0.21.0

2.1.0

  • FEAT: support placeholder property (camunda/element-templates-json-schema#144)
  • DEPS: update to @camunda/element-templates-json-schema@0.18.0
  • DEPS: update to @camunda/zeebe-element-templates-json-schema@0.20.0

2.0.1

2.0.0

  • FIX: do not mark allOf and choices conditions as invalid
  • CHORE: alias to absolute path (#39)
  • DEPS: update to @camunda/element-templates-json-schema@0.17.1
  • DEPS: update to @camunda/zeebe-element-templates-json-schema@0.19.1
  • DEPS: update to ajv@8.12.0
  • DEPS: update to ajv-errors@3

Breaking Changes

  • dataPath property on error objects are renamed to instancePath
  • error messages use "must" instead of "should"

1.8.2

Re-published v1.8.0.

1.8.1

  • FIX: do not mark allOf and choices conditions as invalid
  • DEPS: update to @camunda/element-templates-json-schema@0.17.1
  • DEPS: update to @camunda/zeebe-element-templates-json-schema@0.19.1
  • CHORE: update to ajv@8

1.8.0

1.7.0

  • FEAT: support zeebe:calledElement templating
  • DEPS: update to @camunda/zeebe-element-templates-json-schema@0.17.0

1.6.1

  • FIX: remove zeebe:subscription templating for send task
  • DEPS: update to @camunda/zeebe-element-templates-json-schema@0.16.0
  • DEPS: update to min-dash@4.1.1

1.6.0

  • FEAT: support isActive condition (#28)
  • DEPS: update to @camunda/element-templates-json-schema@0.16.0
  • DEPS: update to @camunda/zeebe-element-templates-json-schema@0.16.0

1.5.0

  • FEAT: support receive and send task templating (#27)
  • DEPS: update to @camunda/zeebe-element-templates-json-schema@0.15.0

1.4.0

Re-published v1.3.0.

1.3.0

Camunda 8 templates

1.2.0

Camunda 8 templates

Camunda 7 templates

1.1.0

  • FEAT: support conditions for dropdown choices
  • DEPS: update to @camunda/element-templates-json-schema@0.14.0
  • DEPS: update to @camunda/zeebe-element-templates-json-schema@0.12.0

1.0.0

  • FEAT: support deprecated property for templates
  • DEPS: update to @camunda/element-templates-json-schema@0.13.0
  • DEPS: update to @camunda/zeebe-element-templates-json-schema@0.11.0

0.15.0

  • FEAT: support tooltips in template groups and properties in zeebe schema
  • DEPS: update zeebe-element-templates-json-schema to v0.10.0

0.14.0

  • FEAT: support message properties
  • DEPS: update element-templates-json-schema to v0.12.1
  • DEPS: update zeebe-element-templates-json-schema to v0.9.0

0.13.0

  • DEPS: update element-templates-json-schema to v0.12.0
  • DEPS: update zeebe-element-templates-json-schema to v0.8.0

0.12.0

  • FEAT: support optional for zeebe:taskHeader binding (element-templates-json-schema#87)
  • DEPS: update element-templates-json-schema to v0.11.0
  • DEPS: update zeebe-element-templates-json-schema to v0.7.0

0.11.0

  • DEPS: update to min-dash@4

0.10.0

  • DEPS: update element-templates-json-schema to v0.10.1
  • DEPS: update zeebe-element-templates-json-schema to v0.6.0

0.9.0

  • DEPS: update element-templates-json-schema to v0.10.0
  • DEPS: update zeebe-element-templates-json-schema to v0.5.0

0.8.1

  • DEPS: update element-templates-json-schema to v0.9.1
  • DEPS: update zeebe-element-templates-json-schema to v0.4.1

0.8.0

  • DEPS: update zeebe-element-templates-json-schema to v0.4.0

0.7.0

  • DEPS: update element-templates-json-schema to v0.9.0
  • DEPS: update zeebe-element-templates-json-schema to v0.3.0

0.6.0

  • DEPS: update element-templates-json-schema to v0.8.0
  • DEPS: update zeebe-element-templates-json-schema to v0.2.0

0.5.0

  • FEAT: add validateZeebe, validateZeebeAll and getZeebeSchemaVersion (#6)
  • FEAT: add getSchemaPackage and getZeebeSchemaPackage (52413fe2)
  • DEPS: update element-templates-json-schema to v0.7.0
  • DEPS: add zeebe-element-templates-json-schema

0.4.0

  • DEPS: update element-templates-json-schema to v0.6.0

0.3.0

  • DEPS: update element-templates-json-schema to v0.5.0
  • DEPS: update dependencies

0.2.0

  • DEPS: update element-templates-json-schema to v0.4.0

0.1.0

  • FEAT: initial version :tada: