Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@bbc/object-based-media-schema
Advanced tools
JSON schemas which describe a common language for object-based media
The Object Based Media Schema was created by BBC R&D to model interactive and personalised media experiences.
To learn about the schema, see docs/SCHEMA.md.
To validate an experience against the schema:
npx @bbc/object-based-media-schema <schema> <file> [<file> ...]
To install the library
npm install --save @bbc/object-based-media-schema
To validate an object based media experience JSON against the schema from your own code:
const { validator } = require('@bbc/object-based-media-schema');
const schema = 'experience/without_production';
validator(schema, storyJson)
.catch(validationErrors => {
/* handle errors */
})
.then( /* success! */);
The first parameter to validator is the path to a part of the schema, without the .json file extension. The second parameter, storyJson, should be a javascript object representing the experience that you've parsed from JSON.
It's possible to validate individual elements of schema json against individual parts of the model by specifying an alternative path. See the contents of the schemas directory for more details.
Note: The object-based media schema includes a production domain that is not required for story modelling or playback. In the example above, the schema specified excludes this production domain. This is probably what you want.
You might want to learn about the schema through the interactive schemaUI, or just explore in more depth. The github repo bundles everything you need to do so.
git clone git@github.com:bbc/object-based-media-schema
cd object-based-media-schema
npm install
To launch the interactive schema UI you'll need to run the following
npm run schemaUI
You should see the following. Visit the URL in your browser to explore.
Started JSON Schema Viewer on port 5000. Visit http://localhost:5000/
To validate a file against the schema using the repo, you'll need to run the following
./bin/validate <schema> <file> [<file> ...]
eg
./bin/validate story/full samples/sample.story.json
To test the samples against the schema you'll need to run the following:
npm run test
If everything's ok, you should expect the following output.
👍 samples/sample.experience_without_production.json
👍 samples/sample.experience_with_production.json
👍 samples/sample.story.json
👍 samples/sample.narrative_element.json
👍 samples/sample.representation_collection.json
👍 samples/sample.representation.json
👍 samples/sample.placeholder_representation.json
👍 samples/sample.asset_collection.json
👍 samples/sample.production.json
👍 samples/sample.scene.json
👍 samples/sample.shot.json
👍 samples/sample.rush.json
👍 samples/sample.production_package.json
👍 samples/sample.shooting_schedule.json
Please read our CONTRIBUTING.md and our CODE_OF_CONDUCT.md if you are interested in making contributions.
The Object Based Media Schema is available to everyone under the terms of the GNU General Public Licence v3.0. Take a look at the licence file and COPYING for more details.
The Object Based Media Schema has been developed over several years and has been informed by conversations with many people. Thanks to contributors Andy Brown, Matthew Brooks, Andy Jones, Thomas Preece, Mike Armstrong, Max Leonard, Jasmine Cox, Dan Strong, Chris Northwood, and the many other colleagues from BBC R&D, BBC D+E and beyond whose ideas have contributed to this work.
FAQs
JSON schemas which describe a common language for object-based media
The npm package @bbc/object-based-media-schema receives a total of 3 weekly downloads. As such, @bbc/object-based-media-schema popularity was classified as not popular.
We found that @bbc/object-based-media-schema demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.