doc-detective-common
v1.15.0
Published
Shared components for Doc Detective projects.
Downloads
846
Readme
Doc Detective Common
Shared resources for Doc Detective projects.
Install
npm i doc-detective-common
Init
const common = require("doc-detective-common");
Methods
.validate(schemaKey: string, object: object)
Validate that object
matches the specified schema definition.
Returns an object with the following schema:
{
"valid": boolean,
"errors": [
{
"instancePath": string,
"schemaPath": string,
"keyword": string,
"params": [{Object}],
"message": string
}
]
}
Usage
const schemaKey = "runShell_v1";
const object = {
action: "runShell",
command: "echo $username",
};
console.log(common.validate(schemaKey, object));
Objects
.schemas
JSON schema definitions for various objects used throughout Doc Detective.
Schema objects are located in the /schemas
directory and made available through the .schemas
object.
{
"analytics_v1": {Object},
"checkLink_v1": {Object},
"click_v1": {Object},
"find_v1": {Object},
"goTo_v1": {Object},
"httpRequest_v1": {Object},
"matchText_v1": {Object},
"moveMouse_v1": {Object},
"runShell_v1": {Object},
"screenshot_v1": {Object},
"scroll_v1": {Object},
"startRecording_v1": {Object},
"stopRecording_v1": {Object},
"type_v1": {Object},
"wait_v1": {Object}
}