fiftyone.pipeline.engines
Advanced tools
Comparing version 4.2.2 to 4.3.0
@@ -33,6 +33,11 @@ /* ********************************************************************* | ||
const errorMessages = require('./errorMessages'); | ||
const ElementData = require51('fiftyone.pipeline.core').ElementData; | ||
const ElementData = require('fiftyone.pipeline.core').ElementData; | ||
const MissingPropertyServiceBase = require('./missingPropertyService'); | ||
/** | ||
* @typedef {import('fiftyone.pipeline.core').FlowElement} FlowElement | ||
* @typedef {import('./missingPropertyService')} MissingPropertyService | ||
*/ | ||
/** | ||
* Extension of elementData which allows for a missing property service | ||
@@ -39,0 +44,0 @@ * to be called when an accessed property isn't available. |
@@ -26,2 +26,7 @@ /* ********************************************************************* | ||
/** | ||
* @typedef {import('fiftyone.pipeline.core').FlowElement} FlowElement | ||
* @typedef {import('./missingPropertyService')} MissingPropertyService | ||
*/ | ||
/** | ||
* Extension of elementDataDictionary which stores a | ||
@@ -28,0 +33,0 @@ * {key,value} dictionary of elements like elementDataDictionary |
@@ -26,2 +26,6 @@ /* ********************************************************************* | ||
/** | ||
* @typedef {import('fiftyone.pipeline.core').FlowElement} FlowElement | ||
*/ | ||
/** | ||
* A datafile used by a FlowElement / Engine to get calculate properties values | ||
@@ -28,0 +32,0 @@ * |
@@ -33,2 +33,7 @@ /* ********************************************************************* | ||
/** | ||
* @typedef {import('fiftyone.pipeline.core').Pipeline} Pipeline | ||
* @typedef {import('./dataFile')} DataFile | ||
*/ | ||
/** | ||
* Datafiles attached to FlowElements register with | ||
@@ -35,0 +40,0 @@ * the dataFileUpdateService so the datafiles can receive |
@@ -31,3 +31,3 @@ /* ********************************************************************* | ||
const FlowElement = require51('fiftyone.pipeline.core').FlowElement; | ||
const FlowElement = require('fiftyone.pipeline.core').FlowElement; | ||
@@ -37,2 +37,8 @@ const DataFileUpdateService = require('./dataFileUpdateService'); | ||
/** | ||
* @typedef {import('./dataFile')} DataFile | ||
* @typedef {import('./dataKeyedCache')} DataKeyedCache | ||
* @typedef {import('fiftyone.pipeline.core').FlowData} FlowData | ||
*/ | ||
/** | ||
* An Engine is an extension of a FlowElement which adds | ||
@@ -48,5 +54,5 @@ * options such as restricting to a subset of properties | ||
* @param {object} options options for the engine | ||
* @param {Datafile} options.dataFile an optional datafile | ||
* @param {DataFile} options.dataFile an optional datafile | ||
* to add to the engine | ||
* @param {Cache} options.cache instance of a DataKeyedCache | ||
* @param {DataKeyedCache} options.cache instance of a DataKeyedCache | ||
* @param {Array} options.restrictedProperties specific list | ||
@@ -144,3 +150,3 @@ * of properties to fetch elementData for | ||
* | ||
* @param {Datafile} dataFile the datafile to register | ||
* @param {DataFile} dataFile the datafile to register | ||
*/ | ||
@@ -147,0 +153,0 @@ registerDataFile (dataFile) { |
@@ -24,3 +24,2 @@ /* ********************************************************************* | ||
module.exports = { | ||
genericMissingProperties: 'Property "%s" not found', | ||
cloudNoPropertiesAccess: ' This is because your resource key does not ' + | ||
@@ -37,6 +36,4 @@ 'include access to any properties under "%s". For more details, see our ' + | ||
'resource key does appear to allow access to this property.', | ||
noReasonUnknown: ' Please check that the element and property names ' + | ||
'are correct.', | ||
propertyExcluded: 'Property "%s" is not present in the results. This ' + | ||
'is because the property has been excluded when configuring the engine.' | ||
} |
@@ -24,3 +24,7 @@ /* ********************************************************************* | ||
const util = require('util'); | ||
const errorMessages = require('./errorMessages'); | ||
const coreErrorMessages = require('fiftyone.pipeline.core').ErrorMessages; | ||
const engineErrorMessages = require('./errorMessages'); | ||
/** | ||
* @typedef {import('fiftyone.pipeline.core').FlowElement} FlowElement | ||
*/ | ||
@@ -38,7 +42,7 @@ /** | ||
* @param {string} key property key | ||
* @param {flowElement} flowElement flowelement the data | ||
* @param {FlowElement} flowElement flowelement the data | ||
* was requested in | ||
*/ | ||
check (key, flowElement) { | ||
let message = util.format(errorMessages.genericMissingProperties, key) + | ||
let message = util.format(coreErrorMessages.genericMissingProperties, key) + | ||
(typeof flowElement === 'undefined' ? '' : ' in data for element "' + flowElement.dataKey) + '".'; | ||
@@ -49,3 +53,3 @@ | ||
message = message + | ||
util.format(errorMessages.cloudNoPropertiesAccess, | ||
util.format(engineErrorMessages.cloudNoPropertiesAccess, | ||
flowElement.dataKey); | ||
@@ -56,10 +60,10 @@ } else { | ||
message = message + | ||
util.format(errorMessages.cloudNoPropertyAccess, | ||
util.format(engineErrorMessages.cloudNoPropertyAccess, | ||
flowElement.dataKey, properties.join(', ')); | ||
} else { | ||
message = message + util.format(errorMessages.cloudReasonUnknown); | ||
message = message + util.format(engineErrorMessages.cloudReasonUnknown); | ||
} | ||
} | ||
} else { | ||
message = message + util.format(errorMessages.noReasonUnknown); | ||
message = message + util.format(coreErrorMessages.noReasonUnknown); | ||
} | ||
@@ -72,3 +76,3 @@ | ||
* Return true if the supplied flow element is a CloudEngine, false if not. | ||
* @param {flowElement} flowElement The flow element to check | ||
* @param {FlowElement} flowElement The flow element to check | ||
*/ | ||
@@ -75,0 +79,0 @@ _isCloudEngine (flowElement) { |
{ | ||
"name": "fiftyone.pipeline.engines", | ||
"version": "4.2.2", | ||
"version": "4.3.0", | ||
"description": "Shared base functionality for implementing engines for the 51Degrees Pipeline API", | ||
@@ -14,3 +14,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"fiftyone.pipeline.core": "^4.2.2" | ||
"fiftyone.pipeline.core": "^4.3.0" | ||
}, | ||
@@ -17,0 +17,0 @@ "devDependencies": { |
@@ -24,2 +24,5 @@ /* ********************************************************************* | ||
const util = require('util'); | ||
const coreErrorMessages = require( | ||
__dirname + '/../../fiftyone.pipeline.core/errorMessages' | ||
) | ||
const errorMessages = require('../errorMessages'); | ||
@@ -109,5 +112,5 @@ const Engine = require(__dirname + '/../engine'); | ||
expect(e.indexOf( | ||
util.format(errorMessages.genericMissingProperties, 'three') + | ||
util.format(coreErrorMessages.genericMissingProperties, 'three') + | ||
' in data for element "testEngine".' + | ||
util.format(errorMessages.noReasonUnknown)) !== -1).toBe(true); | ||
util.format(coreErrorMessages.noReasonUnknown)) !== -1).toBe(true); | ||
} | ||
@@ -114,0 +117,0 @@ |
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
79553
33
2118
19