Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@signalk/signalk-schema

Package Overview
Dependencies
Maintainers
6
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@signalk/signalk-schema - npm Package Compare versions

Comparing version 1.1.1 to 1.3.1

schemas/messages/get.json

14

dist/fullsignalk.js

@@ -143,6 +143,7 @@ 'use strict';

function handleNmea2000Source(labelSource, source, timestamp) {
if (!labelSource[source.src]) {
labelSource[source.src] = {
var existing = labelSource[source.src];
if (!existing) {
existing = labelSource[source.src] = {
n2k: {
src: source.src,
pgns: {}

@@ -152,2 +153,9 @@ }

}
_.assign(existing.n2k, source);
delete existing.n2k.pgn;
delete existing.n2k.label;
delete existing.n2k.instance;
delete existing.n2k.type;
if (source.instance && !labelSource[source.src][source.instance]) {

@@ -154,0 +162,0 @@ labelSource[source.src][source.instance] = {};

@@ -152,2 +152,18 @@ 'use strict';

});
Assertion.addProperty('validSignalKPut', function () {
var result = validateWithSchema(this._obj, 'messages/put.json');
var message = result.error ? result.error.message : '';
if (result.errors) {
message = result.errors.length === 0 ? '' : result.errors[0].message + ':' + result.errors[0].dataPath + ' (' + (result.errors.length - 1) + ' other errors not reported here)';
}
this.assert(result.valid, message, 'expected #{this} to not be valid SignalK put');
});
Assertion.addProperty('validSignalKGet', function () {
var result = validateWithSchema(this._obj, 'messages/get.json');
var message = result.error ? result.error.message : '';
if (result.errors) {
message = result.errors.length === 0 ? '' : result.errors[0].message + ':' + result.errors[0].dataPath + ' (' + (result.errors.length - 1) + ' other errors not reported here)';
}
this.assert(result.valid, message, 'expected #{this} to not be valid SignalK get');
});
Assertion.addProperty('validSubscribeMessage', function () {

@@ -154,0 +170,0 @@ var result = validateWithSchema(this._obj, 'messages/subscribe.json');

{
"name": "@signalk/signalk-schema",
"version": "1.1.1",
"version": "1.3.1",
"description": "SignalK specification schema as an npm module with tests",

@@ -49,3 +49,3 @@ "main": "dist/index.js",

"json-schema-ref-parser": "^3.1.2",
"lodash": "^3.10.1",
"lodash": "^4.17.11",
"tv4": "^1.2.7",

@@ -52,0 +52,0 @@ "tv4-formats": "^3.0.3"

@@ -538,3 +538,3 @@ {

"title": "DisplayName schema.",
"description": "A display name for this value.",
"description": "A display name for this value. This is shown on the gauge and should not include units.",
"example": "Tachometer, Engine 1"

@@ -554,3 +554,3 @@ },

"description": "A short name for this value.",
"example": "RPM"
"example": "Tacho 1"
},

@@ -557,0 +557,0 @@

@@ -70,153 +70,4 @@ {

}
},
"subscribe": {
"type": "array",
"description": "A subscription request",
"items": {
"type": "object",
"properties": {
"path": {
"description": "The relative path of the subscription, supports jsonPath syntax for complex matches",
"type": "string"
},
"period": {
"description": "The period to repeat the message in millisecs",
"example": 1000,
"default": 1000,
"type": "integer"
},
"format": {
"type": "string",
"description": "The message format for periodic messages",
"enum": [
"full",
"delta"
],
"default": "delta"
},
"policy": {
"type": "string",
"description": "The policy rules for repetition. [instant]=send all changes as fast as they are received, but no faster than minPeriod. [ideal]=use instant policy, but send the value every `period` millisecs anyway, whether changed or not. [fixed]=send the last known values every period. ",
"enum": [
"instant",
"ideal",
"fixed"
],
"default": "ideal"
},
"minPeriod": {
"type": "integer",
"description": "The the fastest message transmission rate allowed, e.g. every `minPeriod/1000` seconds."
}
},
"required": [
"path"
]
}
},
"unsubscribe": {
"type": "array",
"description": "An unsubscribe request.",
"items": {
"type": "object",
"properties": {
"path": {
"description": "The relative path to unsubscribe, supports jsonPath syntax for complex matches",
"type": "string"
},
"period": {
"description": "The period to repeat the message in millisecs",
"example": 1000,
"default": 1000,
"type": "integer"
},
"format": {
"type": "string",
"description": "The message format for periodic messages",
"enum": [
"full",
"delta"
],
"default": "delta"
},
"policy": {
"type": "string",
"description": "The policy rules for repetition. [instant]=send all changes as fast as they are received, but no faster than minPeriod. [ideal]=use instant policy, but send the value every `period` millisecs anyway, whether changed or not. [fixed]=send the last known values every period. ",
"enum": [
"instant",
"ideal",
"fixed"
],
"default": "ideal"
},
"minPeriod": {
"type": "integer",
"description": "The the fastest message transmission rate allowed, e.g. every `minPeriod/1000` seconds."
}
},
"required": [
"path"
]
}
},
"get": {
"type": "array",
"description": "A websockets equivalent to a REST GET request.This is for one-off requests, use the subscribe message for regular changes.",
"items": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "The relative path to GET, supports jsonPath syntax for complex matches"
}
},
"required": [
"path"
]
}
},
"list": {
"type": "array",
"description": "Gets a list of known keys for this path",
"items": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "The relative path to list keys for, supports jsonPath syntax for complex matches"
}
},
"required": [
"path"
]
}
},
"put": {
"type": "array",
"description": "A websockets equivalent to a REST PUT request. This is for one-off changes, use the updates message for regular changes.",
"items": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "The relative path to set."
},
"value": {
"type": [
"string",
"number",
"object",
"boolean",
"null"
],
"description": "The value to set at the path"
}
},
"required": [
"path",
"value"
]
}
}
}
}

@@ -479,8 +479,18 @@ {

"$ref": "../definitions.json#/definitions/numberValue",
"description": "Current magnetic heading of the vessel",
"description": "Current magnetic heading of the vessel, equals 'headingCompass adjusted for magneticDeviation'",
"units": "rad"
},
"magneticDeviation": {
"$ref": "../definitions.json#/definitions/numberValue",
"description": "Magnetic deviation of the compass at the current headingCompass",
"units": "rad"
},
"headingCompass": {
"$ref": "../definitions.json#/definitions/numberValue",
"description": "Current magnetic heading received from the compass. This is not adjusted for magneticDeviation of the compass",
"units": "rad"
},
"headingTrue": {
"$ref": "../definitions.json#/definitions/numberValue",
"description": "The current true heading of the vessel",
"description": "The current true north heading of the vessel, equals 'headingMagnetic adjusted for magneticVariation'",
"units": "rad"

@@ -487,0 +497,0 @@ },

@@ -64,2 +64,4 @@ {

"reducedState": {
"type": "object",
"description": "An object describing reduction of sail area",
"properties": {

@@ -66,0 +68,0 @@ "reduced": {

{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "/",
"id": "https://signalk.org/specification/1.0.0/schemas/messages/subscribe.json#",
"title": "SignalK SUBSCRIBE message schema",
"type": "object",
"title": "Subscribe schema.",
"description": "A message to allow a client to subscribe for data updates from a signalk server",
"name": "/",
"properties": {

@@ -9,0 +8,0 @@ "context": {

{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "/",
"id": "https://signalk.org/specification/1.0.0/schemas/messages/unsubscribe.json#",
"title": "SignalK UNSUBSCRIBE message schema",
"type": "object",
"title": "Unsubscribe schema.",
"description": "A message to allow a client to unsubscribe from data updates from a signalk server",
"name": "/",
"properties": {

@@ -9,0 +8,0 @@ "context": {

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc