storyblocks-schema-tool
Last updated 2 years ago by videoblocks-dev .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install storyblocks-schema-tool 
SYNC missed versions from official npm registry.

Storyblocks Schema Tool

Quick Start

Install the schema tool:

npm i -S storyblocks-schema-tool

Create a config file in your project, for example schemas.yml

staging:
  env: 'staging'
  schemasPath: './events/schemas'
  registryUrl: 'http://schema-registry-staging.mysite.com'
  apiKey: 'api_key_goes_here'

prod:
  env: 'prod'
  schemasPath: './events/schemas'
  registryUrl: 'http://schema-registry-prod.mysite.com'
  apiKey: 'api_key_goes_here'

The schema tool requires 2 parameters, env (staging, prod, etc) and config (path to the config)

The easiest way to use this tool is to add scripts to your project's package.json

"scripts": {
  "register-schemas:staging": "register-schemas --config ./path/to/schemas.yml --env staging"
  "register-schemas:prod": "register-schemas --config ./path/to/schemas.yml --env prod"
}

and then running them via npm

npm run register-schemas:staging
npm run register-schemas:prod

Notes

The schema tool expects the schemas directory to be laid out like so:

MySite
    ├── TestEvent1
    │   └── jsonschema
    │       └── 1.0.2 <- this file contains the schema
    └── TestEvent2
        └── jsonschema
            └── 1.0.5
            
MyOtherSite
    ├── TestEvent3
    │   └── jsonschema
    │       └── 2.0.0
    └── TestEvent4
        └── jsonschema
            └── 1.5.2

Todo

  • [ ] add tests
  • [ ] ???
  • [ ] profit!

Current Tags

  • 1.0.7                                ...           latest (2 years ago)

8 Versions

  • 1.0.7                                ...           2 years ago
  • 1.0.6                                ...           2 years ago
  • 1.0.5                                ...           2 years ago
  • 1.0.4                                ...           2 years ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (8)
Dev Dependencies (5)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |