{"name":"protodef-validator","version":"1.5.0","description":"Validate ProtoDef protocol definition in node","main":"index.js","scripts":{"test":"node example.js"},"repository":{"type":"git","url":"git+ssh://git@github.com/ProtoDef-io/node-protodef-validator.git"},"bin":{"protodef-validator":"cli.js"},"keywords":["protodef","type","serialization","schema","json"],"author":{"name":"Romain Beaumont","email":"romain.rom1@gmail.com","url":"<romain.rom1@gmail.com>"},"license":"MIT","bugs":{"url":"https://github.com/ProtoDef-io/node-protodef-validator/issues"},"homepage":"https://github.com/ProtoDef-io/node-protodef-validator#readme","dependencies":{"ajv":"^6.5.4"},"gitHead":"57d83e7230969a50a01dcba8ed72e3f9a9e3d39e","_id":"protodef-validator@1.5.0","_nodeVersion":"24.19.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-GrPKsNpcd7/4bIAZN3Ojgk5ILsRX9s1IItzU+o29D1o0AKbIaLuBCmaSGbZE90Gn8zxF2/Vj8aPUHjo0AbgFdw==","shasum":"55077abb1ed9eb539809c14bc7f4c27a071a3d98","tarball":"http://registry-npm.ywwl.com/protodef-validator/download/protodef-validator-1.5.0.tgz","fileCount":33,"unpackedSize":73459,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/protodef-validator@1.5.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDeRSSchdAUaUXmcXs2juEpWrqru782xmiO2Dok+EFbgAIgF0L+d54WDl27MpuDJ0c/AzCLDbZ3RRX57PVfHtGafyo="}],"size":14647,"noattachment":false,"key":"/protodef-validator/-/protodef-validator-1.5.0.tgz"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:0e87cce5-252f-4552-a480-4bb5c421a10e"}},"directories":{},"maintainers":[{"name":"rom1504","email":"romain.rom1@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/protodef-validator_1.5.0_1787810989692_0.7435160337048021"},"_hasShrinkwrap":false,"readme":"# ProtoDef-validator\n\n[![NPM version](https://img.shields.io/npm/v/protodef-validator.svg)](http://npmjs.com/package/protodef-validator)\n[![Discord](https://img.shields.io/badge/chat-on%20discord-brightgreen.svg)](https://discord.gg/GsEFRM8)\n[![Gitter](https://img.shields.io/badge/chat-on%20gitter-brightgreen.svg)](https://gitter.im/PrismarineJS/general)\n[![Irc](https://img.shields.io/badge/chat-on%20irc-brightgreen.svg)](https://irc.gitter.im/)\n[![Build Status](https://github.com/ProtoDef-io/node-protodef-validator/workflows/CI/badge.svg)](https://github.com/ProtoDef-io/node-protodef-validator/actions?query=workflow%3A%22CI%22)\n[![Try it on gitpod](https://img.shields.io/badge/try-on%20gitpod-brightgreen.svg)](https://gitpod.io/#https://github.com/ProtoDef-io/node-protodef-validator)\n\n\nValidate [ProtoDef](https://github.com/ProtoDef-io/ProtoDef) protocol definition in node\n\n## Installing\n\n```\nnpm install protodef-validator\n```\n\n## Usage\n\nSee [example](example.js)\n\n## Command Line Interface\n\nYou can install this package globally with `npm install -g protodef-validator` and then run `protodef-validator someProtocol.json` to validate it.\n\n## API\n\n### Validator\n\nClass to make validator instances\n\n#### Validator.addType(name [,schema])\n\nadd the type `name` with schema `schema`\n\nIf `schema` isn't specified, use a default schema.\n\n#### Validator.addTypes(schemas)\n\nAdd `schemas` which is an object with keys the name of the schemas and values the schema definitions.\n\n#### Validator.validateType(type)\n\nvalidates a type definition `type`\n\nthrows an exception if the type isn't correct\n\n#### Validator.validateProtocol(protocol)\n\nvalidates a protocol definition `protocol`\n\nthrows an exception if the protocol isn't correct\n\n## History\n\n### 1.5.0\n* [Speed up dataType validation ~12x by collapsing default type branches (#18)](https://github.com/ProtoDef-io/node-protodef-validator/commit/30c2075f2f3dd86e5fc0d748cc863eef42e80c3c) (thanks @u9g)\n* [Fix publish condition for npm-publish v4 (#17)](https://github.com/ProtoDef-io/node-protodef-validator/commit/470e691e191261fe3d84a24249790f11d9f8d875) (thanks @rom1504)\n* [Switch to trusted publishing via OIDC (#16)](https://github.com/ProtoDef-io/node-protodef-validator/commit/6080ed63d0791d470f4c2d0ef5d209431d5ff06b) (thanks @rom1504)\n\n### 1.4.0\n* [Create commands.yml (#14)](https://github.com/ProtoDef-io/node-protodef-validator/commit/3597c71d35a600c76438b2082782032ab40daa97) (thanks @extremeheat)\n* [update submodule (#13)](https://github.com/ProtoDef-io/node-protodef-validator/commit/d79b1085a2590de5e33b811b777b16902134379b) (thanks @extremeheat)\n\n### 1.3.0\n\n* update protodef\n\n### 1.2.3\n\n* add .json suffix when requiring (for webpack)\n\n### 1.2.2\n\n* fix release\n\n### 1.2.1\n\n* update ajv and protodef\n\n### 1.2.0\n\n* allow : in switch keys\n\n### 1.1.7\n\n* properly define compareTo/compareToValue\n\n### 1.1.6\n\n* fix compareToValue switch property allowance\n\n### 1.1.5\n\n* properly normalize schema names\n\n### 1.1.4\n\n* normalize refs\n\n### 1.1.3\n\n* print errors again\n\n### 1.1.2\n\n* fix release\n\n### 1.1.1\n\n* recreate ajv instance to recompile if types were validated hence compiled\n\n### 1.1.0\n\n* check the datatypes have been defined\n* make it possible to add types with a default schema\n* better errors\n\n### 1.0.2\n\n* ignore already added types\n\n### 1.0.1\n\n* fix index.js\n\n### 1.0.0\n\n* can validate types and protocols\n","publish_time":1787810989849,"_cnpm_publish_time":1787810989849,"dist-tags":{"latest":"1.5.0"}}