
Security News
Suno Breached via Shai-Hulud Worm, Leaked Code Exposes AI Music Scraping
A Shai-Hulud infection exposed Suno's source code, which shows the AI music startup stream-ripped tracks to train its models.
@thing-description-playground/core
Advanced tools
Provides the validation functionality for the Web of Things - Thing Description Playground.
This package provides the main functionality of the Web of Things Playground, i.e., validating given Thing Descriptions. You can find more information about the Thingweb-Playground here.
Limitations:
Licensed under the MIT license, see License.
This is a Node.js based tool.
WARNING: If you see an error like ajv.errors[0].params.allowedValue this very probably means that your TD is not valid at a specific point. Scroll up to see the precise error message.
You can use the functionality of this package by:
Install the package with npm npm install @thing-description-playground/core (or clone repo and install the package with npm install)
Node.js or Browser
const tdValidator = require("@thing-description-playground/core").tdValidator
Validators.tdValidator function as a global by adding a script tag to your HTML.<script src="./node_modules/@thing-description-playground/core/dist/web-bundle.min.js"></script>
The index.js file contains the main validation functionality and exports the modules functionalities.
The shared.js file contains additional check functions, which are shared between the core package and the assertions package.
These examples cover all the features of the TD spec. If you think that there is a missing feature not represented, write an issue.
Additionally there are also example scripts provided (in the example-script folder) to demonstrate the usage of this package. Further examples for its usage can be found in the web and cli packages.
Small example for using this package in a Node.js script, to validate an example TD:
const tdValidator = require("@thing-description-playground/core").tdValidator
const fs = require("fs")
const simpleTD = fs.readFileSync("./node_modules/@thing-description-playground/core/examples/tds/valid/simple.json", "utf8")
/**
* Use console for logging, no options
*/
tdValidator(simpleTD, console.log, {})
.then( result => {
console.log("OKAY")
console.log(result)
}, err => {
console.log("ERROR")
console.error(err)
})
The core validation report is an object, which contains three objects (as you can see in the example report):
{
report: {
json: "passed",
schema: "passed",
defaults: "warning",
jsonld: null,
additional: "failed"
},
details: {
enumConst: "passed",
propItems: "warning",
security: "passed",
propUniqueness: "passed",
multiLangConsistency: "failed"
},
detailComments: {
enumConst: "Checking whether a data schema has enum and const at the same time.",
propItems: "Checking whether a data schema has an object but not properties or array but no items.",
security: "Check if used Security definitions are properly defined previously.",
propUniqueness: "Checking whether in one interaction pattern there are duplicate names, e.g. two properties called temp.",
multiLangConsistency: "Checks whether all titles and descriptions have the same language fields."
}
}
report object contains the results of the default validation. It is structure with a keyword and the value null, "passed", "warning" or "failed". Where null is used if the test was not executed, which can happen either because it was opted out or a previous check failed. The keywords are:
details object contains the results of the additional checks. The keywords can have the same values as in report.detailComments explains the meaning of every additional check.Test Examples are located under examples directory.
For examples you need to fill 'typoCount' field that corresponds to the number of typos existing in the TD.
For protocol detection examples you need to fill 'protocolSchemes' field that corresponds to the protocols TD uses.
FAQs
Provides the validation functionality for the Web of Things - Thing Description Playground.
We found that @thing-description-playground/core demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
A Shai-Hulud infection exposed Suno's source code, which shows the AI music startup stream-ripped tracks to train its models.

Security News
Vercel is formalizing a monthly release program for Next.js. The change follows React2Shell and a sharp rise in AI-assisted vulnerability discovery.

Research
/Security News
11 malicious NuGet tools pose as game cheats to deploy Windows payloads, track hosts, and use Google Sheets for telemetry and control.