@ospin/fct-graph
Advanced tools
Comparing version 2.26.0 to 2.26.1
{ | ||
"name": "@ospin/fct-graph", | ||
"author": "danielseehausen", | ||
"version": "2.26.0", | ||
"version": "2.26.1", | ||
"description": "Graph data structure with conditional edges via 'slots' on nodes. Intended to represent physical and virtual functionalities on a device.", | ||
@@ -6,0 +6,0 @@ "main": "index.js", |
@@ -191,2 +191,6 @@ const Joi = require('joi') | ||
getFctsByName(fctName) { | ||
return this.functionalities.filter(({ name }) => name === fctName) | ||
} | ||
getSlotByFctIdAndSlotName(fctId, slotName) { | ||
@@ -193,0 +197,0 @@ const fct = this.getFctById(fctId) |
@@ -6,3 +6,4 @@ const assertFCTGraphFirstArgument = require('../helpers/assertFCTGraphFirstArgument') | ||
const DEFAULT_OPTS = { | ||
customData: {}, | ||
fctData: {}, | ||
slotData: {}, | ||
} | ||
@@ -9,0 +10,0 @@ |
const { v4: uuidv4 } = require('uuid') | ||
const assertFCTGraphFirstArgument = require('../helpers/assertFCTGraphFirstArgument') | ||
@@ -44,2 +43,6 @@ const InSlot = require('../../../slots/InSlot') | ||
if ("customData" in opts) { | ||
console.warn('DEPRECATION WARNING: "customData" key is deprecated. Please use "fctData" instead') | ||
} | ||
const functionalityId = uuidv4() | ||
@@ -61,2 +64,3 @@ | ||
...opts.customData, | ||
...opts.fctData, | ||
slots: [ inSlotData ], | ||
@@ -63,0 +67,0 @@ |
@@ -42,3 +42,3 @@ const { v4: uuidv4 } = require('uuid') | ||
const DEFAULT_OPTS = { | ||
customData: {}, | ||
fctData: {}, | ||
} | ||
@@ -49,2 +49,6 @@ | ||
if ("customData" in opts) { | ||
console.warn('DEPRECATION WARNING: "customData" key is deprecated. Please use "fctData" instead') | ||
} | ||
const functionalityId = uuidv4() | ||
@@ -66,2 +70,3 @@ | ||
...opts.customData, | ||
...opts.fctData, | ||
slots: [ outSlotData ], | ||
@@ -68,0 +73,0 @@ }) |
@@ -6,3 +6,3 @@ const assertFCTGraphFirstArgument = require('../helpers/assertFCTGraphFirstArgument') | ||
const DEFAULT_OPTS = { | ||
customData: {}, | ||
fctData: {}, | ||
} | ||
@@ -9,0 +9,0 @@ |
@@ -1,4 +0,4 @@ | ||
const Functionality = require('./Functionality') | ||
const PhysicalFunctionality = require('./PhysicalFunctionality') | ||
class Actuator extends Functionality { | ||
class Actuator extends PhysicalFunctionality { | ||
@@ -9,11 +9,4 @@ static get TYPE() { | ||
constructor(functionalityData) { | ||
super({ | ||
isVirtual: false, | ||
...functionalityData, | ||
}) | ||
} | ||
} | ||
module.exports = Actuator |
@@ -18,9 +18,2 @@ const Joi = require('joi') | ||
static get PORT_SCHEMA() { | ||
return Joi.object({ | ||
name: Joi.string().required(), | ||
purpose: Joi.string().required(), | ||
}) | ||
} | ||
static get SCHEMA() { | ||
@@ -36,3 +29,2 @@ return Joi.object({ | ||
isVirtual: Joi.boolean().required(), | ||
ports: Joi.array().items(this.PORT_SCHEMA), | ||
firmwareBlackBox: Joi.object(), | ||
@@ -92,3 +84,2 @@ }) | ||
isVirtual = false, | ||
ports = [], | ||
firmwareBlackBox = {}, | ||
@@ -101,3 +92,2 @@ slots: slotsData, | ||
this.isVirtual = isVirtual | ||
this.ports = ports | ||
this.firmwareBlackBox = firmwareBlackBox | ||
@@ -116,3 +106,2 @@ this.slots = [] | ||
isVirtual: this.isVirtual, | ||
ports: this.ports, | ||
firmwareBlackBox: this.firmwareBlackBox, | ||
@@ -119,0 +108,0 @@ slots: this.slots.map(slot => slot.serialize()), |
@@ -12,3 +12,3 @@ const Joi = require('joi') | ||
static get DEFAULT_PUBLISH_INTERVAL() { return 5000 } | ||
static get DEFAULT_PUBLISH_INTERVAL() { return 1000 } | ||
@@ -15,0 +15,0 @@ static get MIN_PUBLISH_INTERVAL() { return 1 } |
@@ -1,4 +0,4 @@ | ||
const Functionality = require('./Functionality') | ||
const PhysicalFunctionality = require('./PhysicalFunctionality') | ||
class Sensor extends Functionality { | ||
class Sensor extends PhysicalFunctionality { | ||
@@ -9,11 +9,4 @@ static get TYPE() { | ||
constructor(functionalityData) { | ||
super({ | ||
isVirtual: false, | ||
...functionalityData, | ||
}) | ||
} | ||
} | ||
module.exports = Sensor |
@@ -1,5 +0,5 @@ | ||
const FunctionalitySeeder = require('./FunctionalitySeeder') | ||
const PhysicalFunctionalitySeeder = require('./PhysicalFunctionalitySeeder') | ||
const Actuator = require('../../functionalities/Actuator') | ||
class ActuatorSeeder extends FunctionalitySeeder { | ||
class ActuatorSeeder extends PhysicalFunctionalitySeeder { | ||
@@ -6,0 +6,0 @@ static generate(data) { |
@@ -24,3 +24,2 @@ const faker = require('faker') | ||
isVirtual: faker.datatype.boolean(), | ||
ports: [], | ||
firmwareBlackBox: {}, | ||
@@ -27,0 +26,0 @@ ...data, |
@@ -1,5 +0,5 @@ | ||
const FunctionalitySeeder = require('./FunctionalitySeeder') | ||
const PhysicalFunctionalitySeeder = require('./PhysicalFunctionalitySeeder') | ||
const Sensor = require('../../functionalities/Sensor') | ||
class SensorSeeder extends FunctionalitySeeder { | ||
class SensorSeeder extends PhysicalFunctionalitySeeder { | ||
@@ -6,0 +6,0 @@ static generate(data) { |
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
149286
104
3082