
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
@ovotech/blaise
Advanced tools
An API to generate mock payloads for @ovotech/castle using @ovotech/avro-mock-generator
An API to generate mock payloads for @ovotech/castle using @ovotech/avro-mock-generator
blaise() is mostly just a chainable deepMerge, with utilities to generate messages and payloads once everything is configured.
Calling blaise() returns a new version of blaise, preloaded with the provided defaults, without mutating the parent.
import blaise from '@ovotech/blaise';
const withAvro = blaise({ avro: { schema } });
const coffee = withAvro({ avro: { pickUnion: ['coffee'] } });
const tea = withAvro({ avro: { pickUnion: ['tea'] } });
coffee.getDefault(); // { avro: { schema, pickUnion: ['coffee']}}
tea.getDefault(); // { avro: { schema, pickUnion: ['tea']}}
import blaise from '@ovotech/blaise';
const schema: avsc.RecordType = {
type: 'record',
name: '',
fields: [{ name: 'anInt', type: 'int' }],
};
type MyType = { anInt: number };
blaise<MyType>({ avro: { schema } }).message(); // {topic: '', {anInt: 32}, [...]}
You can also override the message, either as part of the default or when calling the function
import blaise from '@ovotech/blaise';
const schema: avsc.RecordType = {
// [...]
};
const brewCoffee = blaise({
avro: { schema },
message: { value: { type: 'coffee' } },
});
brewCoffee.message({ value: { with: 'milk' } }); // {offset: 13, value {type: 'coffee', with: 'milk'}, [...]}
CastleEachMessagePayloadimport blaise from '@ovotech/blaise'
const schema: avsc.RecordType = {
// [...]
};
blaise({ avro: { schema }).eachMessage(); // { topic: 'aTopic', value: {} [...]}
CastleEachBatchPayloadimport blaise from '@ovotech/blaise'
const schema: avsc.RecordType = {
// [...]
};
const makeMessage = blaise({ avro: { schema })
blaise.eachBatch([makeMessage()]); // {batch: { topic: 'aTopic', value: {} }[...]}
Make use of the seed options to use a deterministic random generator instead of true randomness.
Each call to .defaults() or .seed() with a seed will reset the randomness.
You can run the tests with:
yarn test
Style is maintained with prettier and eslint
yarn lint
Deployment is preferment by lerna automatically on merge / push to main, but you'll need to bump the package version numbers yourself. Only updated packages with newer versions will be pushed to the npm registry.
Have a bug? File an issue with a simple example that reproduces this so we can take a look & confirm.
Want to make a change? Submit a PR, explain why it's useful, and make sure you've updated the docs (this file) and the tests.
This project is licensed under Apache 2 - see the LICENSE file for details
It's just a fun pun. Take a Castle, make a 'mock' version of it, and you get Bristol's Blaise Castle
FAQs
An API to generate mock payloads for @ovotech/castle using @ovotech/avro-mock-generator
We found that @ovotech/blaise demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 355 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.