@signalk/signalk-schema
Advanced tools
Comparing version 1.3.1 to 1.5.0
@@ -201,4 +201,6 @@ 'use strict'; | ||
previous[pathPart] = {}; | ||
} | ||
if (i === splitPath.length - 1 && typeof previous[pathPart].value === 'undefined') { | ||
var meta = signalkSchema.getMetadata(contextPath + '.' + pathValue.path); | ||
if (meta && i === splitPath.length - 1) { | ||
if (meta) { | ||
//ignore properties from keyswithmetadata.json | ||
@@ -208,2 +210,3 @@ meta = JSON.parse(JSON.stringify(meta)); | ||
_.assign(meta, previous[pathPart].meta); | ||
previous[pathPart].meta = meta; | ||
@@ -210,0 +213,0 @@ } |
@@ -178,2 +178,7 @@ 'use strict'; | ||
}); | ||
Assertion.addProperty('validAuthMessage', function () { | ||
var result = validateWithSchema(this._obj, 'messages/auth.json'); | ||
var message = result.error ? result.error.message + ':' + result.error.dataPath : ''; | ||
this.assert(result.valid, message, 'expected #{this} to not be valid SignalK auth message'); | ||
}); | ||
Assertion.addProperty('validDiscovery', function () { | ||
@@ -247,4 +252,6 @@ var result = validateWithSchema(this._obj, 'discovery'); | ||
} | ||
if (source.src || source.pgn) { | ||
return source.label + (source.src ? '.' + source.src : '') + (source.instance ? '.' + source.instance : ''); | ||
if (source.canName) { | ||
return source.label + '.' + source.canName; | ||
} else if (source.src) { | ||
return source.label + '.' + source.src; | ||
} | ||
@@ -251,0 +258,0 @@ if ((typeof source === 'undefined' ? 'undefined' : _typeof(source)) === 'object') { |
{ | ||
"name": "@signalk/signalk-schema", | ||
"version": "1.3.1", | ||
"version": "1.5.0", | ||
"description": "SignalK specification schema as an npm module with tests", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -39,2 +39,7 @@ { | ||
}, | ||
"canName": { | ||
"type": "string", | ||
"description": "NMEA2000 can name of the source device", | ||
"example": "13877444229283709432" | ||
}, | ||
"pgn": { | ||
@@ -41,0 +46,0 @@ "type": "number", |
@@ -99,16 +99,23 @@ { | ||
"description": "The transmission (gear box) of the named engine", | ||
"properties": { | ||
"properties": { | ||
"gear": { | ||
"type": "object", | ||
"description": "Currently selected gear the engine is in i.e. Forward, Reverse, etc.", | ||
"properties": { | ||
"value": { | ||
"enum": [ | ||
"Forward", | ||
"Neutral", | ||
"Reverse", | ||
"Fault" | ||
] | ||
"allOf": [ | ||
{ | ||
"$ref": "../definitions.json#/definitions/commonValueFields" | ||
}, | ||
{ | ||
"properties": { | ||
"value": { | ||
"enum": [ | ||
"Forward", | ||
"Neutral", | ||
"Reverse", | ||
"Fault" | ||
] | ||
} | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
@@ -115,0 +122,0 @@ "gearRatio": { |
@@ -31,4 +31,10 @@ { | ||
"description": "The distance from the centerline to the sensor location, -ve to starboard, +ve to port" | ||
}, | ||
"class": { | ||
"$ref": "../definitions.json#/definitions/stringValue", | ||
"pattern_": "^[AB]\\Z", | ||
"description": "AIS transponder class in sensors.ais.class, A or B" | ||
} | ||
} | ||
} |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
677458
47
12409
0