@koopjs/featureserver
Advanced tools
Comparing version 8.1.2 to 8.1.3
{ | ||
"name": "@koopjs/featureserver", | ||
"version": "8.1.2", | ||
"version": "8.1.3", | ||
"description": "*An open source implementation of the GeoServices specification*", | ||
@@ -30,9 +30,9 @@ "main": "src/index.js", | ||
"@koopjs/logger": "5.0.0", | ||
"@koopjs/winnow": "4.1.2", | ||
"@koopjs/winnow": "4.1.3", | ||
"@terraformer/spatial": "^2.1.2", | ||
"chroma-js": "^2.0.0", | ||
"chroma-js": "^2.4.2", | ||
"esri-extent": "^1.1.3", | ||
"geojson-validation": "^1.0.2", | ||
"iso-datestring-validator": "^2.2.0", | ||
"joi": "^17.9.2", | ||
"iso-datestring-validator": "^2.2.2", | ||
"joi": "^17.10.1", | ||
"lodash": "^4.17.21", | ||
@@ -46,5 +46,5 @@ "wkt-parser": "^1.3.3" | ||
"proxyquire": "^2.1.3", | ||
"should": "^13.0.0", | ||
"should": "^13.2.3", | ||
"should-sinon": "0.0.6", | ||
"sinon": "^15.0.0", | ||
"sinon": "^15.2.0", | ||
"supertest": "^6.3.3" | ||
@@ -51,0 +51,0 @@ }, |
const { calculateBounds } = require('@terraformer/spatial'); | ||
const { logger } = require('../logger'); | ||
const logManager = require('../logger'); | ||
const normalizeExtent = require('./normalize-extent'); | ||
@@ -14,3 +14,3 @@ | ||
} catch (error) { | ||
logger.debug(`Could not calculate extent from data: ${error.message}`); | ||
logManager.logger.debug(`Could not calculate extent from data: ${error.message}`); | ||
} | ||
@@ -17,0 +17,0 @@ } |
@@ -9,3 +9,3 @@ const _ = require('lodash'); | ||
const { calculateBounds } = require('@terraformer/spatial'); | ||
const { logger } = require('../logger'); | ||
const logManager = require('../logger'); | ||
const getSpatialReference = require('./get-spatial-reference'); | ||
@@ -117,3 +117,3 @@ const getGeometryTypeFromGeojson = require('./get-geometry-type-from-geojson'); | ||
} catch (error) { | ||
logger.debug(`Could not calculate extent from data: ${error.message}`); | ||
logManager.logger.debug(`Could not calculate extent from data: ${error.message}`); | ||
} | ||
@@ -120,0 +120,0 @@ } |
@@ -8,3 +8,3 @@ const _ = require('lodash'); | ||
} = require('./field-classes'); | ||
const { logger } = require('../../logger'); | ||
const logManager = require('../../logger'); | ||
@@ -39,3 +39,3 @@ class Fields { | ||
if (shouldWarnAboutMissingIdFieldDefinition(idField, fieldDefinitions)) { | ||
logger.debug(`provider's "idField" is set to ${idField}, but this field is not found in field-definitions`); | ||
logManager.logger.debug(`provider's "idField" is set to ${idField}, but this field is not found in field-definitions`); | ||
} | ||
@@ -42,0 +42,0 @@ |
const _ = require('lodash'); | ||
const { logger } = require('../logger'); | ||
const logManager = require('../logger'); | ||
@@ -21,3 +21,3 @@ const esriLookup = { | ||
if (!type) { | ||
logger.debug(`Input JSON has unsupported geometryType: ${type}`); | ||
logManager.logger.debug(`Input JSON has unsupported geometryType: ${type}`); | ||
} | ||
@@ -24,0 +24,0 @@ return esriLookup[type]; |
const esriProjCodes = require('@esri/proj-codes'); | ||
const Joi = require('joi'); | ||
const wktParser = require('wkt-parser'); | ||
const { logger } = require('../logger'); | ||
const logManager = require('../logger'); | ||
const wktLookup = new Map(); | ||
@@ -22,3 +22,3 @@ const schema = Joi.alternatives( | ||
if (error) { | ||
logger.verbose(` ${input} is not a valid spatial reference; defaulting to none, error: ${error}`); | ||
logManager.logger.verbose(` ${input} is not a valid spatial reference; defaulting to none, error: ${error}`); | ||
@@ -85,3 +85,3 @@ // Todo: throw error | ||
// Todo - throw error | ||
logger.verbose(`An unknown spatial reference was detected: ${lookupValue}; defaulting to none`); | ||
logManager.logger.verbose(`An unknown spatial reference was detected: ${lookupValue}; defaulting to none`); | ||
return; | ||
@@ -104,3 +104,3 @@ } | ||
} catch (err) { | ||
logger.debug(`An un-parseable WKT spatial reference was detected: ${wkt}`); | ||
logManager.logger.debug(`An un-parseable WKT spatial reference was detected: ${wkt}`); | ||
// Todo: throw error | ||
@@ -107,0 +107,0 @@ } |
const _ = require('lodash'); | ||
const wktParser = require('wkt-parser'); | ||
const projCodes = require('@esri/proj-codes'); | ||
const { logger } = require('../logger'); | ||
const logManager = require('../logger'); | ||
const esriUnitsLookup = require('./esri-units-lookup'); | ||
@@ -65,3 +65,3 @@ const defaults = require('../metadata-defaults'); | ||
} catch (error) { | ||
logger.debug( | ||
logManager.logger.debug( | ||
`Could not set feature service units from spatial reference: ${error}`, | ||
@@ -68,0 +68,0 @@ ); |
const joi = require('joi'); | ||
const _ = require('lodash'); | ||
const geojsonhint = require('geojson-validation'); | ||
const { logger } = require('../logger'); | ||
const { KOOP_LOG_LEVEL, LOG_LEVEL } = process.env; | ||
const logManager = require('../logger'); | ||
const { VALIDATE_GEOJSON } = process.env; | ||
@@ -29,9 +30,10 @@ const queryParamSchema = joi | ||
function shouldValidateGeojson() { | ||
return LOG_LEVEL === 'debug' || KOOP_LOG_LEVEL === 'debug'; | ||
return !_.isUndefined(VALIDATE_GEOJSON); | ||
} | ||
// TODO: move this out of feature server | ||
function validateGeojson(geojson) { | ||
const geojsonErrors = geojsonhint.valid(geojson, true); | ||
if (geojsonErrors.length > 0) { | ||
logger.debug( | ||
logManager.logger.debug( | ||
`source data for contains invalid GeoJSON; ${geojsonErrors[0]}`, | ||
@@ -38,0 +40,0 @@ ); |
@@ -1,21 +0,22 @@ | ||
let logger = require('./logger'); | ||
const Logger = require('@koopjs/logger'); | ||
const Logger = require('@koopjs/logger'); | ||
let logger = new Logger(); | ||
const winnow = require('@koopjs/winnow'); | ||
module.exports = { | ||
logger, | ||
setLogger, | ||
}; | ||
get logger () { | ||
return logger; | ||
}, | ||
function setLogger({ logger: _logger, logLevel }) { | ||
if (_logger) { | ||
logger = _logger; | ||
logger.silly('FeatureServer no longer using default logger.'); | ||
winnow.setLogger({ logger }); | ||
return; | ||
setLogger: ({ logger: _logger, logLevel }) => { | ||
if (_logger) { | ||
logger = _logger; | ||
logger.silly('FeatureServer no longer using default logger.'); | ||
winnow.setLogger({ logger }); | ||
return; | ||
} | ||
if (logLevel) { | ||
logger = new Logger({ logLevel }); | ||
} | ||
} | ||
if (logLevel) { | ||
logger = new Logger({ logLevel }); | ||
} | ||
} | ||
}; |
const _ = require('lodash'); | ||
const { getDataTypeFromValue } = require('../helpers'); | ||
const { logger } = require('../logger'); | ||
const logManager = require('../logger'); | ||
@@ -10,3 +10,3 @@ function logWarnings(geojson, format) { | ||
if (esriFormat && !metadata.idField) { | ||
logger.debug( | ||
logManager.logger.debug( | ||
'requested provider has no "idField" assignment. You will get the most reliable behavior from ArcGIS clients if the provider assigns the "idField" to a property that is an unchanging 32-bit integer. An OBJECTID field will be auto-generated in the absence of an "idField" assignment.', | ||
@@ -17,3 +17,3 @@ ); | ||
if (esriFormat && hasMixedCaseObjectIdKey(metadata.idField)) { | ||
logger.debug( | ||
logManager.logger.debug( | ||
'requested provider has "idField" that is a mixed-case version of "OBJECTID". This can cause errors in ArcGIS clients.', | ||
@@ -40,3 +40,3 @@ ); | ||
if (!featureField || hasTypeMismatch(type, featureField)) { | ||
logger.debug( | ||
logManager.logger.debug( | ||
`field definition "${name} (${type})" not found in first feature of provider's GeoJSON`, | ||
@@ -53,3 +53,3 @@ ); | ||
if (!definition && key !== 'OBJECTID') { | ||
logger.debug( | ||
logManager.logger.debug( | ||
`requested provider has feature with property "${key}" that was not defined in metadata fields array`, | ||
@@ -56,0 +56,0 @@ ); |
const _ = require('lodash'); | ||
const layerInfo = require('./layer-metadata'); | ||
const query = require('./query'); | ||
const { logger } = require('./logger'); | ||
const logManager = require('./logger'); | ||
const queryRelatedRecords = require('./queryRelatedRecords.js'); | ||
@@ -54,3 +54,3 @@ const generateRenderer = require('./generate-renderer'); | ||
} catch (error) { | ||
logger.debug(error); | ||
logManager.logger.debug(error); | ||
const { code = 500 , message, details = [message] } = error; | ||
@@ -57,0 +57,0 @@ |
@@ -10,3 +10,3 @@ const _ = require('lodash'); | ||
} = require('./helpers'); | ||
const { logger } = require('./logger'); | ||
const logManager = require('./logger'); | ||
const ServerMetadata = require('./helpers/server-metadata'); | ||
@@ -118,3 +118,3 @@ | ||
} catch (error) { | ||
logger.debug(`Could not calculate extent from data: ${error.message}`); | ||
logManager.logger.debug(`Could not calculate extent from data: ${error.message}`); | ||
} | ||
@@ -136,3 +136,3 @@ } | ||
} catch (error) { | ||
logger.warn(`Could not normalize extent: ${ error }`); | ||
logManager.logger.warn(`Could not normalize extent: ${ error }`); | ||
} | ||
@@ -139,0 +139,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
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
98788
51
+ Added@koopjs/winnow@4.1.3(transitive)
- Removed@koopjs/winnow@4.1.2(transitive)
Updated@koopjs/winnow@4.1.3
Updatedchroma-js@^2.4.2
Updatedjoi@^17.10.1