diff --git a/lib/cartodb/api/api-router.js b/lib/cartodb/api/api-router.js index 6083ab0c..fafc90b3 100644 --- a/lib/cartodb/api/api-router.js +++ b/lib/cartodb/api/api-router.js @@ -1,3 +1,5 @@ +'use strict'; + const { Router: router } = require('express'); const RedisPool = require('redis-mpool'); diff --git a/lib/cartodb/api/map/analyses-catalog-controller.js b/lib/cartodb/api/map/analyses-catalog-controller.js index 2fae5ac2..f7f66346 100644 --- a/lib/cartodb/api/map/analyses-catalog-controller.js +++ b/lib/cartodb/api/map/analyses-catalog-controller.js @@ -1,3 +1,5 @@ +'use strict'; + const PSQL = require('cartodb-psql'); const cleanUpQueryParams = require('../middlewares/clean-up-query-params'); const credentials = require('../middlewares/credentials'); diff --git a/lib/cartodb/api/map/analysis-layergroup-controller.js b/lib/cartodb/api/map/analysis-layergroup-controller.js index 41acf819..0375d9ed 100644 --- a/lib/cartodb/api/map/analysis-layergroup-controller.js +++ b/lib/cartodb/api/map/analysis-layergroup-controller.js @@ -1,3 +1,5 @@ +'use strict'; + const layergroupToken = require('../middlewares/layergroup-token'); const cleanUpQueryParams = require('../middlewares/clean-up-query-params'); const credentials = require('../middlewares/credentials'); diff --git a/lib/cartodb/api/map/anonymous-map-controller.js b/lib/cartodb/api/map/anonymous-map-controller.js index 656d9787..ef47f5b6 100644 --- a/lib/cartodb/api/map/anonymous-map-controller.js +++ b/lib/cartodb/api/map/anonymous-map-controller.js @@ -1,3 +1,5 @@ +'use strict'; + const windshaft = require('windshaft'); const MapConfig = windshaft.model.MapConfig; const Datasource = windshaft.model.Datasource; @@ -152,17 +154,17 @@ function prepareAdapterMapConfig (mapConfigAdapter) { } }; - mapConfigAdapter.getMapConfig(user, - requestMapConfig, - params, - context, + mapConfigAdapter.getMapConfig(user, + requestMapConfig, + params, + context, (err, requestMapConfig, stats = { overviewsAddedToMapconfig : false }) => { req.profiler.done('anonymous.getMapConfig'); - + stats.mapType = 'anonymous'; req.profiler.add(stats); - + if (err) { return next(err); } diff --git a/lib/cartodb/api/map/attributes-layergroup-controller.js b/lib/cartodb/api/map/attributes-layergroup-controller.js index 2723ebd0..9ab394d7 100644 --- a/lib/cartodb/api/map/attributes-layergroup-controller.js +++ b/lib/cartodb/api/map/attributes-layergroup-controller.js @@ -1,3 +1,5 @@ +'use strict'; + const layergroupToken = require('../middlewares/layergroup-token'); const cleanUpQueryParams = require('../middlewares/clean-up-query-params'); const credentials = require('../middlewares/credentials'); diff --git a/lib/cartodb/api/map/dataview-layergroup-controller.js b/lib/cartodb/api/map/dataview-layergroup-controller.js index 5fd666ea..d82556b8 100644 --- a/lib/cartodb/api/map/dataview-layergroup-controller.js +++ b/lib/cartodb/api/map/dataview-layergroup-controller.js @@ -1,3 +1,5 @@ +'use strict'; + const layergroupToken = require('../middlewares/layergroup-token'); const cleanUpQueryParams = require('../middlewares/clean-up-query-params'); const credentials = require('../middlewares/credentials'); diff --git a/lib/cartodb/api/map/map-router.js b/lib/cartodb/api/map/map-router.js index 46e2be5e..dac55670 100644 --- a/lib/cartodb/api/map/map-router.js +++ b/lib/cartodb/api/map/map-router.js @@ -1,3 +1,5 @@ +'use strict'; + const { Router: router } = require('express'); const AnalysisLayergroupController = require('./analysis-layergroup-controller'); diff --git a/lib/cartodb/api/map/preview-layergroup-controller.js b/lib/cartodb/api/map/preview-layergroup-controller.js index 975d3f56..bf516f5e 100644 --- a/lib/cartodb/api/map/preview-layergroup-controller.js +++ b/lib/cartodb/api/map/preview-layergroup-controller.js @@ -1,3 +1,5 @@ +'use strict'; + const layergroupToken = require('../middlewares/layergroup-token'); const coordinates = require('../middlewares/coordinates'); const cleanUpQueryParams = require('../middlewares/clean-up-query-params'); diff --git a/lib/cartodb/api/map/preview-template-controller.js b/lib/cartodb/api/map/preview-template-controller.js index 321bb882..eea382de 100644 --- a/lib/cartodb/api/map/preview-template-controller.js +++ b/lib/cartodb/api/map/preview-template-controller.js @@ -1,3 +1,5 @@ +'use strict'; + const cleanUpQueryParams = require('../middlewares/clean-up-query-params'); const credentials = require('../middlewares/credentials'); const dbConnSetup = require('../middlewares/db-conn-setup'); diff --git a/lib/cartodb/api/map/tile-layergroup-controller.js b/lib/cartodb/api/map/tile-layergroup-controller.js index 477ae444..422fa8b6 100644 --- a/lib/cartodb/api/map/tile-layergroup-controller.js +++ b/lib/cartodb/api/map/tile-layergroup-controller.js @@ -1,3 +1,5 @@ +'use strict'; + const layergroupToken = require('../middlewares/layergroup-token'); const coordinates = require('../middlewares/coordinates'); const cleanUpQueryParams = require('../middlewares/clean-up-query-params'); diff --git a/lib/cartodb/api/middlewares/augment-layergroup-data.js b/lib/cartodb/api/middlewares/augment-layergroup-data.js index 65a6702d..d58e2fb2 100644 --- a/lib/cartodb/api/middlewares/augment-layergroup-data.js +++ b/lib/cartodb/api/middlewares/augment-layergroup-data.js @@ -1,3 +1,5 @@ +'use strict'; + const _ = require('underscore'); module.exports = function augmentLayergroupData () { diff --git a/lib/cartodb/api/middlewares/authorize.js b/lib/cartodb/api/middlewares/authorize.js index 54cab1c4..619f1f74 100644 --- a/lib/cartodb/api/middlewares/authorize.js +++ b/lib/cartodb/api/middlewares/authorize.js @@ -1,3 +1,5 @@ +'use strict'; + module.exports = function authorize (authBackend) { return function authorizeMiddleware (req, res, next) { authBackend.authorize(req, res, (err, authorized) => { diff --git a/lib/cartodb/api/middlewares/cache-channel-header.js b/lib/cartodb/api/middlewares/cache-channel-header.js index d6bf394b..03b3d2e1 100644 --- a/lib/cartodb/api/middlewares/cache-channel-header.js +++ b/lib/cartodb/api/middlewares/cache-channel-header.js @@ -1,3 +1,5 @@ +'use strict'; + module.exports = function setCacheChannelHeader () { return function setCacheChannelHeaderMiddleware (req, res, next) { if (req.method !== 'GET') { diff --git a/lib/cartodb/api/middlewares/cache-control-header.js b/lib/cartodb/api/middlewares/cache-control-header.js index 574ae3b5..d72ee0c3 100644 --- a/lib/cartodb/api/middlewares/cache-control-header.js +++ b/lib/cartodb/api/middlewares/cache-control-header.js @@ -1,3 +1,5 @@ +'use strict'; + const ONE_YEAR_IN_SECONDS = 60 * 60 * 24 * 365; module.exports = function setCacheControlHeader ({ ttl = ONE_YEAR_IN_SECONDS, revalidate = false } = {}) { diff --git a/lib/cartodb/api/middlewares/check-json-content-type.js b/lib/cartodb/api/middlewares/check-json-content-type.js index 05aa6f26..6f02c750 100644 --- a/lib/cartodb/api/middlewares/check-json-content-type.js +++ b/lib/cartodb/api/middlewares/check-json-content-type.js @@ -1,3 +1,5 @@ +'use strict'; + module.exports = function checkJsonContentType () { return function checkJsonContentTypeMiddleware(req, res, next) { if (req.method === 'POST' && !req.is('application/json')) { diff --git a/lib/cartodb/api/middlewares/check-static-image-format.js b/lib/cartodb/api/middlewares/check-static-image-format.js index 9b9c8b24..411240db 100644 --- a/lib/cartodb/api/middlewares/check-static-image-format.js +++ b/lib/cartodb/api/middlewares/check-static-image-format.js @@ -1,3 +1,5 @@ +'use strict'; + const VALID_IMAGE_FORMATS = ['png', 'jpg']; module.exports = function checkStaticImageFormat () { diff --git a/lib/cartodb/api/middlewares/clean-up-query-params.js b/lib/cartodb/api/middlewares/clean-up-query-params.js index 768b35f2..898b5358 100644 --- a/lib/cartodb/api/middlewares/clean-up-query-params.js +++ b/lib/cartodb/api/middlewares/clean-up-query-params.js @@ -1,3 +1,5 @@ +'use strict'; + const _ = require('underscore'); // Whitelist query parameters and attach format diff --git a/lib/cartodb/api/middlewares/coordinates.js b/lib/cartodb/api/middlewares/coordinates.js index d0840393..5c48439c 100644 --- a/lib/cartodb/api/middlewares/coordinates.js +++ b/lib/cartodb/api/middlewares/coordinates.js @@ -1,3 +1,5 @@ +'use strict'; + const positiveIntegerNumberRegExp = /^\d+$/; const integerNumberRegExp = /^-?\d+$/; const invalidZoomMessage = function (zoom) { diff --git a/lib/cartodb/api/middlewares/cors.js b/lib/cartodb/api/middlewares/cors.js index 12db26ac..34b06bf5 100644 --- a/lib/cartodb/api/middlewares/cors.js +++ b/lib/cartodb/api/middlewares/cors.js @@ -1,3 +1,5 @@ +'use strict'; + module.exports = function cors () { return function corsMiddleware (req, res, next) { const headers = [ diff --git a/lib/cartodb/api/middlewares/credentials.js b/lib/cartodb/api/middlewares/credentials.js index b202de47..71316f4b 100644 --- a/lib/cartodb/api/middlewares/credentials.js +++ b/lib/cartodb/api/middlewares/credentials.js @@ -1,3 +1,5 @@ +'use strict'; + const basicAuth = require('basic-auth'); module.exports = function credentials () { diff --git a/lib/cartodb/api/middlewares/db-conn-setup.js b/lib/cartodb/api/middlewares/db-conn-setup.js index ce3f6ac0..0ab4d105 100644 --- a/lib/cartodb/api/middlewares/db-conn-setup.js +++ b/lib/cartodb/api/middlewares/db-conn-setup.js @@ -1,3 +1,5 @@ +'use strict'; + const _ = require('underscore'); module.exports = function dbConnSetup (pgConnection) { diff --git a/lib/cartodb/api/middlewares/error-middleware.js b/lib/cartodb/api/middlewares/error-middleware.js index c1533b43..a81c87a0 100644 --- a/lib/cartodb/api/middlewares/error-middleware.js +++ b/lib/cartodb/api/middlewares/error-middleware.js @@ -1,3 +1,5 @@ +'use strict'; + const _ = require('underscore'); const debug = require('debug')('windshaft:cartodb:error-middleware'); diff --git a/lib/cartodb/api/middlewares/increment-map-view-count.js b/lib/cartodb/api/middlewares/increment-map-view-count.js index acf241fd..6afb8c76 100644 --- a/lib/cartodb/api/middlewares/increment-map-view-count.js +++ b/lib/cartodb/api/middlewares/increment-map-view-count.js @@ -1,3 +1,5 @@ +'use strict'; + module.exports = function incrementMapViewCount (metadataBackend) { return function incrementMapViewCountMiddleware(req, res, next) { const { mapConfig, user } = res.locals; diff --git a/lib/cartodb/api/middlewares/init-profiler.js b/lib/cartodb/api/middlewares/init-profiler.js index 6d0be211..86916822 100644 --- a/lib/cartodb/api/middlewares/init-profiler.js +++ b/lib/cartodb/api/middlewares/init-profiler.js @@ -1,3 +1,5 @@ +'use strict'; + module.exports = function initProfiler (isTemplateInstantiation) { const operation = isTemplateInstantiation ? 'instance_template' : 'createmap'; diff --git a/lib/cartodb/api/middlewares/initialize-status-code.js b/lib/cartodb/api/middlewares/initialize-status-code.js index ed6b1805..db35bb51 100644 --- a/lib/cartodb/api/middlewares/initialize-status-code.js +++ b/lib/cartodb/api/middlewares/initialize-status-code.js @@ -1,3 +1,5 @@ +'use strict'; + module.exports = function initializeStatusCode () { return function initializeStatusCodeMiddleware (req, res, next) { if (req.method !== 'OPTIONS') { diff --git a/lib/cartodb/api/middlewares/last-modified-header.js b/lib/cartodb/api/middlewares/last-modified-header.js index d1fcee47..3f6c6e6a 100644 --- a/lib/cartodb/api/middlewares/last-modified-header.js +++ b/lib/cartodb/api/middlewares/last-modified-header.js @@ -1,3 +1,5 @@ +'use strict'; + module.exports = function setLastModifiedHeader () { return function setLastModifiedHeaderMiddleware(req, res, next) { if (req.method !== 'GET') { diff --git a/lib/cartodb/api/middlewares/last-updated-time-layergroup.js b/lib/cartodb/api/middlewares/last-updated-time-layergroup.js index f883fc35..d0520316 100644 --- a/lib/cartodb/api/middlewares/last-updated-time-layergroup.js +++ b/lib/cartodb/api/middlewares/last-updated-time-layergroup.js @@ -1,3 +1,5 @@ +'use strict'; + module.exports = function setLastUpdatedTimeToLayergroup () { return function setLastUpdatedTimeToLayergroupMiddleware (req, res, next) { const { mapConfigProvider, analysesResults } = res.locals; diff --git a/lib/cartodb/api/middlewares/layer-stats.js b/lib/cartodb/api/middlewares/layer-stats.js index e6ca00e6..2df472f7 100644 --- a/lib/cartodb/api/middlewares/layer-stats.js +++ b/lib/cartodb/api/middlewares/layer-stats.js @@ -1,3 +1,5 @@ +'use strict'; + module.exports = function setLayerStats (pgConnection, statsBackend) { return function setLayerStatsMiddleware(req, res, next) { const { user, mapConfig } = res.locals; diff --git a/lib/cartodb/api/middlewares/layergroup-id-header.js b/lib/cartodb/api/middlewares/layergroup-id-header.js index 8141d6a6..94470972 100644 --- a/lib/cartodb/api/middlewares/layergroup-id-header.js +++ b/lib/cartodb/api/middlewares/layergroup-id-header.js @@ -1,3 +1,5 @@ +'use strict'; + module.exports = function setLayergroupIdHeader (templateMaps, useTemplateHash) { return function setLayergroupIdHeaderMiddleware (req, res, next) { const { user, template } = res.locals; diff --git a/lib/cartodb/api/middlewares/layergroup-metadata.js b/lib/cartodb/api/middlewares/layergroup-metadata.js index a9cec443..ae1fddba 100644 --- a/lib/cartodb/api/middlewares/layergroup-metadata.js +++ b/lib/cartodb/api/middlewares/layergroup-metadata.js @@ -1,3 +1,5 @@ +'use strict'; + module.exports = function setMetadataToLayergroup (layergroupMetadata, includeQuery) { return function setMetadataToLayergroupMiddleware (req, res, next) { const { user, mapConfig, analysesResults = [], context, api_key: userApiKey } = res.locals; diff --git a/lib/cartodb/api/middlewares/layergroup-token.js b/lib/cartodb/api/middlewares/layergroup-token.js index 0e6553d2..fcc6959b 100644 --- a/lib/cartodb/api/middlewares/layergroup-token.js +++ b/lib/cartodb/api/middlewares/layergroup-token.js @@ -1,3 +1,5 @@ +'use strict'; + const LayergroupToken = require('../../models/layergroup-token'); const authErrorMessageTemplate = function (signer, user) { return `Cannot use map signature of user "${signer}" on db of user "${user}"`; diff --git a/lib/cartodb/api/middlewares/logger.js b/lib/cartodb/api/middlewares/logger.js index ccd51d45..da198d64 100644 --- a/lib/cartodb/api/middlewares/logger.js +++ b/lib/cartodb/api/middlewares/logger.js @@ -1,3 +1,5 @@ +'use strict'; + module.exports = function logger (options) { if (!global.log4js || !options.log_format) { return function dummyLoggerMiddleware (req, res, next) { diff --git a/lib/cartodb/api/middlewares/lzma.js b/lib/cartodb/api/middlewares/lzma.js index b0a94412..dee7ee61 100644 --- a/lib/cartodb/api/middlewares/lzma.js +++ b/lib/cartodb/api/middlewares/lzma.js @@ -1,3 +1,5 @@ +'use strict'; + const LZMA = require('lzma').LZMA; module.exports = function lzma () { diff --git a/lib/cartodb/api/middlewares/map-error.js b/lib/cartodb/api/middlewares/map-error.js index 6d87a93d..7c0ec278 100644 --- a/lib/cartodb/api/middlewares/map-error.js +++ b/lib/cartodb/api/middlewares/map-error.js @@ -1,3 +1,5 @@ +'use strict'; + module.exports = function mapError (options) { const { addContext = false, label = 'MAPS CONTROLLER' } = options; diff --git a/lib/cartodb/api/middlewares/map-store-map-config-provider.js b/lib/cartodb/api/middlewares/map-store-map-config-provider.js index a5b4b1f6..37c624c5 100644 --- a/lib/cartodb/api/middlewares/map-store-map-config-provider.js +++ b/lib/cartodb/api/middlewares/map-store-map-config-provider.js @@ -1,3 +1,5 @@ +'use strict'; + const MapStoreMapConfigProvider = require('../../models/mapconfig/provider/map-store-provider'); module.exports = function createMapStoreMapConfigProvider ( diff --git a/lib/cartodb/api/middlewares/named-map-provider.js b/lib/cartodb/api/middlewares/named-map-provider.js index 08f0cad5..9134dd29 100644 --- a/lib/cartodb/api/middlewares/named-map-provider.js +++ b/lib/cartodb/api/middlewares/named-map-provider.js @@ -1,3 +1,5 @@ +'use strict'; + module.exports = function getNamedMapProvider ({ namedMapProviderCache, label, forcedFormat = null }) { return function getNamedMapProviderMiddleware (req, res, next) { const { user, token, cache_buster, api_key } = res.locals; diff --git a/lib/cartodb/api/middlewares/noop.js b/lib/cartodb/api/middlewares/noop.js index 16ceabbe..9cfa684b 100644 --- a/lib/cartodb/api/middlewares/noop.js +++ b/lib/cartodb/api/middlewares/noop.js @@ -1,3 +1,5 @@ +'use strict'; + module.exports = function noop () { return function noopMiddleware (req, res, next) { next(); diff --git a/lib/cartodb/api/middlewares/send-response.js b/lib/cartodb/api/middlewares/send-response.js index ec13c5bf..3e858aff 100644 --- a/lib/cartodb/api/middlewares/send-response.js +++ b/lib/cartodb/api/middlewares/send-response.js @@ -1,3 +1,5 @@ +'use strict'; + module.exports = function sendResponse () { return function sendResponseMiddleware (req, res) { req.profiler.done('res'); diff --git a/lib/cartodb/api/middlewares/served-by-host-header.js b/lib/cartodb/api/middlewares/served-by-host-header.js index 809100a2..297cc945 100644 --- a/lib/cartodb/api/middlewares/served-by-host-header.js +++ b/lib/cartodb/api/middlewares/served-by-host-header.js @@ -1,3 +1,5 @@ +'use strict'; + const os = require('os'); module.exports = function servedByHostHeader () { diff --git a/lib/cartodb/api/middlewares/stats.js b/lib/cartodb/api/middlewares/stats.js index 53d2cf9a..51dbdf53 100644 --- a/lib/cartodb/api/middlewares/stats.js +++ b/lib/cartodb/api/middlewares/stats.js @@ -1,3 +1,5 @@ +'use strict'; + const Profiler = require('../../stats/profiler_proxy'); const debug = require('debug')('windshaft:cartodb:stats'); const onHeaders = require('on-headers'); diff --git a/lib/cartodb/api/middlewares/surrogate-key-header.js b/lib/cartodb/api/middlewares/surrogate-key-header.js index d2a3243c..f616b009 100644 --- a/lib/cartodb/api/middlewares/surrogate-key-header.js +++ b/lib/cartodb/api/middlewares/surrogate-key-header.js @@ -1,3 +1,5 @@ +'use strict'; + const NamedMapsCacheEntry = require('../../cache/model/named_maps_entry'); const NamedMapMapConfigProvider = require('../../models/mapconfig/provider/named-map-provider'); diff --git a/lib/cartodb/api/middlewares/syntax-error.js b/lib/cartodb/api/middlewares/syntax-error.js index ad4df4e8..c293cef3 100644 --- a/lib/cartodb/api/middlewares/syntax-error.js +++ b/lib/cartodb/api/middlewares/syntax-error.js @@ -1,3 +1,5 @@ +'use strict'; + module.exports = function syntaxError () { return function syntaxErrorMiddleware (err, req, res, next) { if (err.name === 'SyntaxError') { diff --git a/lib/cartodb/api/middlewares/user.js b/lib/cartodb/api/middlewares/user.js index 551fa001..4dda75e7 100644 --- a/lib/cartodb/api/middlewares/user.js +++ b/lib/cartodb/api/middlewares/user.js @@ -1,3 +1,5 @@ +'use strict'; + const CdbRequest = require('../../models/cdb_request'); module.exports = function user () { diff --git a/lib/cartodb/api/middlewares/vector-error.js b/lib/cartodb/api/middlewares/vector-error.js index 7e2ec75f..4de1ebce 100644 --- a/lib/cartodb/api/middlewares/vector-error.js +++ b/lib/cartodb/api/middlewares/vector-error.js @@ -1,3 +1,5 @@ +'use strict'; + const fs = require('fs'); const timeoutErrorVectorTile = fs.readFileSync(__dirname + '/../../../../assets/render-timeout-fallback.mvt'); diff --git a/lib/cartodb/api/template/admin-template-controller.js b/lib/cartodb/api/template/admin-template-controller.js index 4a727d23..c8d2ba97 100644 --- a/lib/cartodb/api/template/admin-template-controller.js +++ b/lib/cartodb/api/template/admin-template-controller.js @@ -1,3 +1,5 @@ +'use strict'; + const { templateName } = require('../../backends/template_maps'); const credentials = require('../middlewares/credentials'); const rateLimit = require('../middlewares/rate-limit'); diff --git a/lib/cartodb/api/template/named-template-controller.js b/lib/cartodb/api/template/named-template-controller.js index 0408ed3a..b28143dd 100644 --- a/lib/cartodb/api/template/named-template-controller.js +++ b/lib/cartodb/api/template/named-template-controller.js @@ -1,3 +1,5 @@ +'use strict'; + const cleanUpQueryParams = require('../middlewares/clean-up-query-params'); const credentials = require('../middlewares/credentials'); const dbConnSetup = require('../middlewares/db-conn-setup'); diff --git a/lib/cartodb/api/template/template-router.js b/lib/cartodb/api/template/template-router.js index 4234bb22..0299679d 100644 --- a/lib/cartodb/api/template/template-router.js +++ b/lib/cartodb/api/template/template-router.js @@ -1,3 +1,5 @@ +'use strict'; + const { Router: router } = require('express'); const NamedMapController = require('./named-template-controller'); diff --git a/lib/cartodb/api/template/tile-template-controller.js b/lib/cartodb/api/template/tile-template-controller.js index 71a45e6e..daf751e6 100644 --- a/lib/cartodb/api/template/tile-template-controller.js +++ b/lib/cartodb/api/template/tile-template-controller.js @@ -1,3 +1,5 @@ +'use strict'; + const coordinates = require('../middlewares/coordinates'); const cleanUpQueryParams = require('../middlewares/clean-up-query-params'); const credentials = require('../middlewares/credentials'); diff --git a/lib/cartodb/backends/analysis-status.js b/lib/cartodb/backends/analysis-status.js index 0060f36b..1c636f4e 100644 --- a/lib/cartodb/backends/analysis-status.js +++ b/lib/cartodb/backends/analysis-status.js @@ -1,3 +1,5 @@ +'use strict'; + var PSQL = require('cartodb-psql'); function AnalysisStatusBackend() { diff --git a/lib/cartodb/backends/auth.js b/lib/cartodb/backends/auth.js index 879a1a18..0a17e4a2 100644 --- a/lib/cartodb/backends/auth.js +++ b/lib/cartodb/backends/auth.js @@ -1,3 +1,5 @@ +'use strict'; + /** * * @param {PgConnection} pgConnection diff --git a/lib/cartodb/backends/dataview.js b/lib/cartodb/backends/dataview.js index 99a115e6..acdf24a7 100644 --- a/lib/cartodb/backends/dataview.js +++ b/lib/cartodb/backends/dataview.js @@ -1,3 +1,5 @@ +'use strict'; + var _ = require('underscore'); var PSQL = require('cartodb-psql'); var BBoxFilter = require('../models/filter/bbox'); diff --git a/lib/cartodb/backends/filter-stats.js b/lib/cartodb/backends/filter-stats.js index b37d8704..c5fb48bb 100644 --- a/lib/cartodb/backends/filter-stats.js +++ b/lib/cartodb/backends/filter-stats.js @@ -1,3 +1,5 @@ +'use strict'; + var _ = require('underscore'); var AnalysisFilter = require('../models/filter/analysis'); diff --git a/lib/cartodb/backends/layer-stats/empty-layer-stats.js b/lib/cartodb/backends/layer-stats/empty-layer-stats.js index 0760c0b6..72c76e84 100644 --- a/lib/cartodb/backends/layer-stats/empty-layer-stats.js +++ b/lib/cartodb/backends/layer-stats/empty-layer-stats.js @@ -1,3 +1,5 @@ +'use strict'; + function EmptyLayerStats(types) { this._types = types || {}; } diff --git a/lib/cartodb/backends/layer-stats/factory.js b/lib/cartodb/backends/layer-stats/factory.js index 8aacdb5a..19eb0701 100644 --- a/lib/cartodb/backends/layer-stats/factory.js +++ b/lib/cartodb/backends/layer-stats/factory.js @@ -1,3 +1,5 @@ +'use strict'; + var LayerStats = require('./layer-stats'); var EmptyLayerStats = require('./empty-layer-stats'); var MapnikLayerStats = require('./mapnik-layer-stats'); diff --git a/lib/cartodb/backends/layer-stats/layer-stats.js b/lib/cartodb/backends/layer-stats/layer-stats.js index 2464fb22..38e9b461 100644 --- a/lib/cartodb/backends/layer-stats/layer-stats.js +++ b/lib/cartodb/backends/layer-stats/layer-stats.js @@ -1,3 +1,5 @@ +'use strict'; + var queue = require('queue-async'); function LayerStats(layerStatsIterator) { diff --git a/lib/cartodb/backends/layer-stats/mapnik-layer-stats.js b/lib/cartodb/backends/layer-stats/mapnik-layer-stats.js index 67d00d90..829dfd24 100644 --- a/lib/cartodb/backends/layer-stats/mapnik-layer-stats.js +++ b/lib/cartodb/backends/layer-stats/mapnik-layer-stats.js @@ -1,3 +1,5 @@ +'use strict'; + const queryUtils = require('../../utils/query-utils'); const AggregationMapConfig = require('../../models/aggregation/aggregation-mapconfig'); const aggregationQuery = require('../../models/aggregation/aggregation-query'); diff --git a/lib/cartodb/backends/layer-stats/torque-layer-stats.js b/lib/cartodb/backends/layer-stats/torque-layer-stats.js index 00b4def2..af198b1e 100644 --- a/lib/cartodb/backends/layer-stats/torque-layer-stats.js +++ b/lib/cartodb/backends/layer-stats/torque-layer-stats.js @@ -1,3 +1,5 @@ +'use strict'; + function TorqueLayerStats() { this._types = { torque: true diff --git a/lib/cartodb/backends/overviews-metadata.js b/lib/cartodb/backends/overviews-metadata.js index 7eb7c889..f066c4ef 100644 --- a/lib/cartodb/backends/overviews-metadata.js +++ b/lib/cartodb/backends/overviews-metadata.js @@ -1,3 +1,5 @@ +'use strict'; + const queryUtils = require('../utils/query-utils'); function OverviewsMetadataBackend(pgQueryRunner) { diff --git a/lib/cartodb/backends/pg_connection.js b/lib/cartodb/backends/pg_connection.js index 0a9b29bd..9c7ed4c3 100644 --- a/lib/cartodb/backends/pg_connection.js +++ b/lib/cartodb/backends/pg_connection.js @@ -1,3 +1,5 @@ +'use strict'; + var PSQL = require('cartodb-psql'); var _ = require('underscore'); const debug = require('debug')('cachechan'); diff --git a/lib/cartodb/backends/pg_query_runner.js b/lib/cartodb/backends/pg_query_runner.js index d3a16719..c96041c4 100644 --- a/lib/cartodb/backends/pg_query_runner.js +++ b/lib/cartodb/backends/pg_query_runner.js @@ -1,3 +1,5 @@ +'use strict'; + var PSQL = require('cartodb-psql'); function PgQueryRunner(pgConnection) { diff --git a/lib/cartodb/backends/stats.js b/lib/cartodb/backends/stats.js index b0385bac..c3e5303d 100644 --- a/lib/cartodb/backends/stats.js +++ b/lib/cartodb/backends/stats.js @@ -1,3 +1,5 @@ +'use strict'; + var layerStats = require('./layer-stats/factory'); function StatsBackend() { diff --git a/lib/cartodb/backends/tables-extent.js b/lib/cartodb/backends/tables-extent.js index 5e78a6b1..ff41701c 100644 --- a/lib/cartodb/backends/tables-extent.js +++ b/lib/cartodb/backends/tables-extent.js @@ -1,3 +1,5 @@ +'use strict'; + function TablesExtentBackend(pgQueryRunner) { this.pgQueryRunner = pgQueryRunner; } diff --git a/lib/cartodb/backends/template_maps.js b/lib/cartodb/backends/template_maps.js index 41e655bd..ea2d93fd 100644 --- a/lib/cartodb/backends/template_maps.js +++ b/lib/cartodb/backends/template_maps.js @@ -1,3 +1,5 @@ +'use strict'; + var crypto = require('crypto'); var debug = require('debug')('windshaft:templates'); var _ = require('underscore'); diff --git a/lib/cartodb/backends/user-limits.js b/lib/cartodb/backends/user-limits.js index 2dc70470..6177007a 100644 --- a/lib/cartodb/backends/user-limits.js +++ b/lib/cartodb/backends/user-limits.js @@ -1,3 +1,5 @@ +'use strict'; + /** * * @param metadataBackend diff --git a/lib/cartodb/cache/backend/fastly.js b/lib/cartodb/cache/backend/fastly.js index 1dad622c..e1ca6b35 100644 --- a/lib/cartodb/cache/backend/fastly.js +++ b/lib/cartodb/cache/backend/fastly.js @@ -1,3 +1,5 @@ +'use strict'; + var FastlyPurge = require('fastly-purge'); function FastlyCacheBackend(apiKey, serviceId) { diff --git a/lib/cartodb/cache/backend/varnish_http.js b/lib/cartodb/cache/backend/varnish_http.js index 760e1f11..35fa5330 100644 --- a/lib/cartodb/cache/backend/varnish_http.js +++ b/lib/cartodb/cache/backend/varnish_http.js @@ -1,3 +1,5 @@ +'use strict'; + var request = require('request'); function VarnishHttpCacheBackend(host, port) { diff --git a/lib/cartodb/cache/layergroup_affected_tables.js b/lib/cartodb/cache/layergroup_affected_tables.js index d33c5a73..fb63eb37 100644 --- a/lib/cartodb/cache/layergroup_affected_tables.js +++ b/lib/cartodb/cache/layergroup_affected_tables.js @@ -1,3 +1,5 @@ +'use strict'; + var LruCache = require('lru-cache'); function LayergroupAffectedTables() { diff --git a/lib/cartodb/cache/model/named_maps_entry.js b/lib/cartodb/cache/model/named_maps_entry.js index aaab7f3a..a4537368 100644 --- a/lib/cartodb/cache/model/named_maps_entry.js +++ b/lib/cartodb/cache/model/named_maps_entry.js @@ -1,3 +1,5 @@ +'use strict'; + var crypto = require('crypto'); function NamedMaps(owner, name) { diff --git a/lib/cartodb/cache/named_map_provider_cache.js b/lib/cartodb/cache/named_map_provider_cache.js index b64decb1..d0e34883 100644 --- a/lib/cartodb/cache/named_map_provider_cache.js +++ b/lib/cartodb/cache/named_map_provider_cache.js @@ -1,3 +1,5 @@ +'use strict'; + var _ = require('underscore'); var dot = require('dot'); var NamedMapMapConfigProvider = require('../models/mapconfig/provider/named-map-provider'); diff --git a/lib/cartodb/cache/surrogate_keys_cache.js b/lib/cartodb/cache/surrogate_keys_cache.js index 907e6345..bf4bc852 100644 --- a/lib/cartodb/cache/surrogate_keys_cache.js +++ b/lib/cartodb/cache/surrogate_keys_cache.js @@ -1,3 +1,5 @@ +'use strict'; + var queue = require('queue-async'); /** diff --git a/lib/cartodb/models/aggregation/aggregation-mapconfig.js b/lib/cartodb/models/aggregation/aggregation-mapconfig.js index 98a71962..abd53fe3 100644 --- a/lib/cartodb/models/aggregation/aggregation-mapconfig.js +++ b/lib/cartodb/models/aggregation/aggregation-mapconfig.js @@ -1,3 +1,5 @@ +'use strict'; + const MapConfig = require('windshaft').model.MapConfig; const aggregationQuery = require('./aggregation-query'); const aggregationValidator = require('./aggregation-validator'); diff --git a/lib/cartodb/models/aggregation/aggregation-query.js b/lib/cartodb/models/aggregation/aggregation-query.js index 54a8e280..1bddf02d 100644 --- a/lib/cartodb/models/aggregation/aggregation-query.js +++ b/lib/cartodb/models/aggregation/aggregation-query.js @@ -1,3 +1,5 @@ +'use strict'; + const timeDimension = require('./time-dimension'); const DEFAULT_PLACEMENT = 'point-sample'; diff --git a/lib/cartodb/models/aggregation/aggregation-validator.js b/lib/cartodb/models/aggregation/aggregation-validator.js index ce038f05..257e7980 100644 --- a/lib/cartodb/models/aggregation/aggregation-validator.js +++ b/lib/cartodb/models/aggregation/aggregation-validator.js @@ -1,3 +1,5 @@ +'use strict'; + module.exports = function aggregationValidator (mapconfig) { return function validateProperty (key, validator) { for (let index = 0; index < mapconfig.getLayers().length; index++) { diff --git a/lib/cartodb/models/aggregation/time-dimension.js b/lib/cartodb/models/aggregation/time-dimension.js index 6d1fe635..9d3e85bf 100644 --- a/lib/cartodb/models/aggregation/time-dimension.js +++ b/lib/cartodb/models/aggregation/time-dimension.js @@ -1,3 +1,5 @@ +'use strict'; + // timezones can be defined either by an numeric offset in seconds or by // a valid (case-insensitive) tz/PG name; // they include abbreviations defined by PG (which have precedence and diff --git a/lib/cartodb/models/cdb_request.js b/lib/cartodb/models/cdb_request.js index 6650dd08..54593c17 100644 --- a/lib/cartodb/models/cdb_request.js +++ b/lib/cartodb/models/cdb_request.js @@ -1,3 +1,5 @@ +'use strict'; + function CdbRequest() { this.RE_USER_FROM_HOST = new RegExp(global.environment.user_from_host || '^([^\\.]+)\\.' // would extract "strk" from "strk.cartodb.com" diff --git a/lib/cartodb/models/dataview/aggregation.js b/lib/cartodb/models/dataview/aggregation.js index 7820ddbc..4efbbba2 100644 --- a/lib/cartodb/models/dataview/aggregation.js +++ b/lib/cartodb/models/dataview/aggregation.js @@ -1,3 +1,5 @@ +'use strict'; + const BaseDataview = require('./base'); const debug = require('debug')('windshaft:dataview:aggregation'); diff --git a/lib/cartodb/models/dataview/base.js b/lib/cartodb/models/dataview/base.js index 455461a2..8525224f 100644 --- a/lib/cartodb/models/dataview/base.js +++ b/lib/cartodb/models/dataview/base.js @@ -1,3 +1,5 @@ +'use strict'; + const FLOAT_OIDS = { 700: true, 701: true, diff --git a/lib/cartodb/models/dataview/factory.js b/lib/cartodb/models/dataview/factory.js index fa55641c..729305fc 100644 --- a/lib/cartodb/models/dataview/factory.js +++ b/lib/cartodb/models/dataview/factory.js @@ -1,3 +1,5 @@ +'use strict'; + const dataviews = require('./'); module.exports = class DataviewFactory { diff --git a/lib/cartodb/models/dataview/formula.js b/lib/cartodb/models/dataview/formula.js index df009e4b..a0b3278a 100644 --- a/lib/cartodb/models/dataview/formula.js +++ b/lib/cartodb/models/dataview/formula.js @@ -1,3 +1,5 @@ +'use strict'; + const BaseDataview = require('./base'); const debug = require('debug')('windshaft:dataview:formula'); const utils = require('../../utils/query-utils'); diff --git a/lib/cartodb/models/dataview/histogram.js b/lib/cartodb/models/dataview/histogram.js index affbbd25..bc51979e 100644 --- a/lib/cartodb/models/dataview/histogram.js +++ b/lib/cartodb/models/dataview/histogram.js @@ -1,3 +1,5 @@ +'use strict'; + const debug = require('debug')('windshaft:dataview:histogram'); const NumericHistogram = require('./histograms/numeric-histogram'); const DateHistogram = require('./histograms/date-histogram'); diff --git a/lib/cartodb/models/dataview/histograms/base-histogram.js b/lib/cartodb/models/dataview/histograms/base-histogram.js index ec251d09..29496632 100644 --- a/lib/cartodb/models/dataview/histograms/base-histogram.js +++ b/lib/cartodb/models/dataview/histograms/base-histogram.js @@ -1,3 +1,5 @@ +'use strict'; + const BaseDataview = require('../base'); const TYPE = 'histogram'; diff --git a/lib/cartodb/models/dataview/histograms/date-histogram.js b/lib/cartodb/models/dataview/histograms/date-histogram.js index 86e0e539..632c4438 100644 --- a/lib/cartodb/models/dataview/histograms/date-histogram.js +++ b/lib/cartodb/models/dataview/histograms/date-histogram.js @@ -1,3 +1,5 @@ +'use strict'; + const BaseHistogram = require('./base-histogram'); const debug = require('debug')('windshaft:dataview:date-histogram'); const utils = require('../../../utils/query-utils'); diff --git a/lib/cartodb/models/dataview/histograms/numeric-histogram.js b/lib/cartodb/models/dataview/histograms/numeric-histogram.js index f26a0f80..ddf3577f 100644 --- a/lib/cartodb/models/dataview/histograms/numeric-histogram.js +++ b/lib/cartodb/models/dataview/histograms/numeric-histogram.js @@ -1,3 +1,5 @@ +'use strict'; + const BaseHistogram = require('./base-histogram'); const debug = require('debug')('windshaft:dataview:numeric-histogram'); const utils = require('../../../utils/query-utils'); diff --git a/lib/cartodb/models/dataview/index.js b/lib/cartodb/models/dataview/index.js index 05cfaab7..0fc107d3 100644 --- a/lib/cartodb/models/dataview/index.js +++ b/lib/cartodb/models/dataview/index.js @@ -1,3 +1,5 @@ +'use strict'; + module.exports = { Aggregation: require('./aggregation'), Formula: require('./formula'), diff --git a/lib/cartodb/models/dataview/overviews/aggregation.js b/lib/cartodb/models/dataview/overviews/aggregation.js index 312a398e..1d0f7de6 100644 --- a/lib/cartodb/models/dataview/overviews/aggregation.js +++ b/lib/cartodb/models/dataview/overviews/aggregation.js @@ -1,3 +1,5 @@ +'use strict'; + var BaseOverviewsDataview = require('./base'); var BaseDataview = require('../aggregation'); var debug = require('debug')('windshaft:widget:aggregation:overview'); diff --git a/lib/cartodb/models/dataview/overviews/base.js b/lib/cartodb/models/dataview/overviews/base.js index 38b2c119..9b1c7c58 100644 --- a/lib/cartodb/models/dataview/overviews/base.js +++ b/lib/cartodb/models/dataview/overviews/base.js @@ -1,3 +1,5 @@ +'use strict'; + var _ = require('underscore'); var BaseDataview = require('../base'); diff --git a/lib/cartodb/models/dataview/overviews/factory.js b/lib/cartodb/models/dataview/overviews/factory.js index d7a07d54..1a402f88 100644 --- a/lib/cartodb/models/dataview/overviews/factory.js +++ b/lib/cartodb/models/dataview/overviews/factory.js @@ -1,3 +1,5 @@ +'use strict'; + var parentFactory = require('../factory'); var dataviews = require('./'); diff --git a/lib/cartodb/models/dataview/overviews/formula.js b/lib/cartodb/models/dataview/overviews/formula.js index dd487ccb..73aa2f57 100644 --- a/lib/cartodb/models/dataview/overviews/formula.js +++ b/lib/cartodb/models/dataview/overviews/formula.js @@ -1,3 +1,5 @@ +'use strict'; + var BaseOverviewsDataview = require('./base'); var BaseDataview = require('../formula'); var debug = require('debug')('windshaft:widget:formula:overview'); diff --git a/lib/cartodb/models/dataview/overviews/histogram.js b/lib/cartodb/models/dataview/overviews/histogram.js index cc7e7342..91c2818c 100644 --- a/lib/cartodb/models/dataview/overviews/histogram.js +++ b/lib/cartodb/models/dataview/overviews/histogram.js @@ -1,3 +1,5 @@ +'use strict'; + var _ = require('underscore'); var BaseOverviewsDataview = require('./base'); var BaseDataview = require('../histogram'); @@ -278,5 +280,3 @@ Histogram.prototype._shouldOverride = function (override) { Histogram.prototype._shouldOverrideBins = function (override) { return override && _.has(override, 'bins'); }; - - diff --git a/lib/cartodb/models/dataview/overviews/index.js b/lib/cartodb/models/dataview/overviews/index.js index ac032749..8b5cf9f7 100644 --- a/lib/cartodb/models/dataview/overviews/index.js +++ b/lib/cartodb/models/dataview/overviews/index.js @@ -1,3 +1,5 @@ +'use strict'; + module.exports = { Aggregation: require('./aggregation'), Formula: require('./formula'), diff --git a/lib/cartodb/models/filter/analysis.js b/lib/cartodb/models/filter/analysis.js index a0975662..1da580c6 100644 --- a/lib/cartodb/models/filter/analysis.js +++ b/lib/cartodb/models/filter/analysis.js @@ -1,3 +1,5 @@ +'use strict'; + var filters = { category: require('./analysis/category'), range: require('./analysis/range') diff --git a/lib/cartodb/models/filter/bbox.js b/lib/cartodb/models/filter/bbox.js index 0f7072ae..1766ba8c 100644 --- a/lib/cartodb/models/filter/bbox.js +++ b/lib/cartodb/models/filter/bbox.js @@ -1,3 +1,5 @@ +'use strict'; + var debug = require('debug')('windshaft:filter:bbox'); var dot = require('dot'); dot.templateSettings.strip = false; diff --git a/lib/cartodb/models/layergroup-token.js b/lib/cartodb/models/layergroup-token.js index 67691bf6..8c51bed5 100644 --- a/lib/cartodb/models/layergroup-token.js +++ b/lib/cartodb/models/layergroup-token.js @@ -1,3 +1,5 @@ +'use strict'; + /** * @param {String} token might match the following pattern: {user}@{tpl_id}@{token}:{cache_buster} */ diff --git a/lib/cartodb/models/mapconfig/adapter/aggregation-mapconfig-adapter.js b/lib/cartodb/models/mapconfig/adapter/aggregation-mapconfig-adapter.js index 82de77d1..ceb3e031 100644 --- a/lib/cartodb/models/mapconfig/adapter/aggregation-mapconfig-adapter.js +++ b/lib/cartodb/models/mapconfig/adapter/aggregation-mapconfig-adapter.js @@ -1,3 +1,5 @@ +'use strict'; + const AggregationMapConfig = require('../../aggregation/aggregation-mapconfig'); const queryUtils = require('../../../utils/query-utils'); diff --git a/lib/cartodb/models/mapconfig/adapter/analysis-mapconfig-adapter.js b/lib/cartodb/models/mapconfig/adapter/analysis-mapconfig-adapter.js index 9fdd2d09..c4a71272 100644 --- a/lib/cartodb/models/mapconfig/adapter/analysis-mapconfig-adapter.js +++ b/lib/cartodb/models/mapconfig/adapter/analysis-mapconfig-adapter.js @@ -1,3 +1,5 @@ +'use strict'; + var queue = require('queue-async'); var debug = require('debug')('windshaft:analysis'); diff --git a/lib/cartodb/models/mapconfig/adapter/dataviews-widgets-adapter.js b/lib/cartodb/models/mapconfig/adapter/dataviews-widgets-adapter.js index 8ae13272..f59c0d27 100644 --- a/lib/cartodb/models/mapconfig/adapter/dataviews-widgets-adapter.js +++ b/lib/cartodb/models/mapconfig/adapter/dataviews-widgets-adapter.js @@ -1,3 +1,5 @@ +'use strict'; + function DataviewsWidgetsMapConfigAdapter() { } diff --git a/lib/cartodb/models/mapconfig/adapter/mapconfig-buffer-size-adapter.js b/lib/cartodb/models/mapconfig/adapter/mapconfig-buffer-size-adapter.js index aead2d91..07fc45bc 100644 --- a/lib/cartodb/models/mapconfig/adapter/mapconfig-buffer-size-adapter.js +++ b/lib/cartodb/models/mapconfig/adapter/mapconfig-buffer-size-adapter.js @@ -1,3 +1,5 @@ +'use strict'; + function MapConfigBufferSizeAdapter() { this.formats = ['png', 'png32', 'mvt', 'grid.json']; } diff --git a/lib/cartodb/models/mapconfig/adapter/mapconfig-named-layers-adapter.js b/lib/cartodb/models/mapconfig/adapter/mapconfig-named-layers-adapter.js index f652e675..68d2a950 100644 --- a/lib/cartodb/models/mapconfig/adapter/mapconfig-named-layers-adapter.js +++ b/lib/cartodb/models/mapconfig/adapter/mapconfig-named-layers-adapter.js @@ -1,3 +1,5 @@ +'use strict'; + var queue = require('queue-async'); var _ = require('underscore'); var Datasource = require('windshaft').model.Datasource; diff --git a/lib/cartodb/models/mapconfig/adapter/mapconfig-overviews-adapter.js b/lib/cartodb/models/mapconfig/adapter/mapconfig-overviews-adapter.js index 47179028..3d0f6580 100644 --- a/lib/cartodb/models/mapconfig/adapter/mapconfig-overviews-adapter.js +++ b/lib/cartodb/models/mapconfig/adapter/mapconfig-overviews-adapter.js @@ -1,3 +1,5 @@ +'use strict'; + var queue = require('queue-async'); var _ = require('underscore'); diff --git a/lib/cartodb/models/mapconfig/adapter/sql-wrap-mapconfig-adapter.js b/lib/cartodb/models/mapconfig/adapter/sql-wrap-mapconfig-adapter.js index 8bb3d201..e3f030ce 100644 --- a/lib/cartodb/models/mapconfig/adapter/sql-wrap-mapconfig-adapter.js +++ b/lib/cartodb/models/mapconfig/adapter/sql-wrap-mapconfig-adapter.js @@ -1,3 +1,5 @@ +'use strict'; + function SqlWrapMapConfigAdapter() { } diff --git a/lib/cartodb/models/mapconfig/adapter/vector-mapconfig-adapter.js b/lib/cartodb/models/mapconfig/adapter/vector-mapconfig-adapter.js index bedea8b8..dd03f3fe 100644 --- a/lib/cartodb/models/mapconfig/adapter/vector-mapconfig-adapter.js +++ b/lib/cartodb/models/mapconfig/adapter/vector-mapconfig-adapter.js @@ -1,3 +1,5 @@ +'use strict'; + const queryUtils = require('../../../utils/query-utils'); const dateWrapper = require('../../../utils/date-wrapper'); @@ -60,4 +62,4 @@ class VectorMapConfigAdapter { } -module.exports = VectorMapConfigAdapter; \ No newline at end of file +module.exports = VectorMapConfigAdapter; diff --git a/lib/cartodb/models/mapconfig/provider/base-mapconfig-adapter.js b/lib/cartodb/models/mapconfig/provider/base-mapconfig-adapter.js index c783bdd4..de156217 100644 --- a/lib/cartodb/models/mapconfig/provider/base-mapconfig-adapter.js +++ b/lib/cartodb/models/mapconfig/provider/base-mapconfig-adapter.js @@ -1,3 +1,5 @@ +'use strict'; + const QueryTables = require('cartodb-query-tables'); module.exports = class BaseMapConfigProvider { diff --git a/lib/cartodb/models/mapconfig/provider/create-layergroup-provider.js b/lib/cartodb/models/mapconfig/provider/create-layergroup-provider.js index 6d33c912..15e2fc6f 100644 --- a/lib/cartodb/models/mapconfig/provider/create-layergroup-provider.js +++ b/lib/cartodb/models/mapconfig/provider/create-layergroup-provider.js @@ -1,3 +1,5 @@ +'use strict'; + const MapStoreMapConfigProvider = require('./map-store-provider'); module.exports = class CreateLayergroupMapConfigProvider extends MapStoreMapConfigProvider { diff --git a/lib/cartodb/models/mapconfig/provider/map-store-provider.js b/lib/cartodb/models/mapconfig/provider/map-store-provider.js index b3210298..b0dda9d1 100644 --- a/lib/cartodb/models/mapconfig/provider/map-store-provider.js +++ b/lib/cartodb/models/mapconfig/provider/map-store-provider.js @@ -1,3 +1,5 @@ +'use strict'; + const BaseMapConfigProvider = require('./base-mapconfig-adapter'); const dot = require('dot'); diff --git a/lib/cartodb/models/mapconfig/provider/named-map-provider.js b/lib/cartodb/models/mapconfig/provider/named-map-provider.js index ee0e0bd2..513fb7b7 100644 --- a/lib/cartodb/models/mapconfig/provider/named-map-provider.js +++ b/lib/cartodb/models/mapconfig/provider/named-map-provider.js @@ -1,3 +1,5 @@ +'use strict'; + const BaseMapConfigProvider = require('./base-mapconfig-adapter'); const crypto = require('crypto'); const dot = require('dot'); diff --git a/lib/cartodb/monitoring/health_check.js b/lib/cartodb/monitoring/health_check.js index 294390cf..31cc8245 100644 --- a/lib/cartodb/monitoring/health_check.js +++ b/lib/cartodb/monitoring/health_check.js @@ -1,3 +1,5 @@ +'use strict'; + var fs = require('fs'); function HealthCheck(disableFile) { diff --git a/lib/cartodb/server-info-controller.js b/lib/cartodb/server-info-controller.js index 17e0649c..d81051cb 100644 --- a/lib/cartodb/server-info-controller.js +++ b/lib/cartodb/server-info-controller.js @@ -1,3 +1,5 @@ +'use strict'; + var HealthCheck = require('./monitoring/health_check'); var WELCOME_MSG = "This is the CartoDB Maps API, " + diff --git a/lib/cartodb/server.js b/lib/cartodb/server.js index ea51f2db..6303fab2 100644 --- a/lib/cartodb/server.js +++ b/lib/cartodb/server.js @@ -1,3 +1,5 @@ +'use strict'; + const _ = require('underscore'); const express = require('express'); const windshaft = require('windshaft'); diff --git a/lib/cartodb/server_options.js b/lib/cartodb/server_options.js index d1996b6b..5c19ee9a 100644 --- a/lib/cartodb/server_options.js +++ b/lib/cartodb/server_options.js @@ -1,3 +1,5 @@ +'use strict'; + const fqdn = require('@carto/fqdn-sync'); var _ = require('underscore'); var OverviewsQueryRewriter = require('./utils/overviews_query_rewriter'); diff --git a/lib/cartodb/stats/client.js b/lib/cartodb/stats/client.js index 614344cb..be6f6c13 100644 --- a/lib/cartodb/stats/client.js +++ b/lib/cartodb/stats/client.js @@ -1,3 +1,5 @@ +'use strict'; + var _ = require('underscore'); var debug = require('debug')('windshaft:stats_client'); var StatsD = require('node-statsd').StatsD; @@ -70,4 +72,4 @@ module.exports = { return this.instance; } -}; \ No newline at end of file +}; diff --git a/lib/cartodb/stats/profiler_proxy.js b/lib/cartodb/stats/profiler_proxy.js index 1e1f91e7..5ac60d57 100644 --- a/lib/cartodb/stats/profiler_proxy.js +++ b/lib/cartodb/stats/profiler_proxy.js @@ -1,3 +1,5 @@ +'use strict'; + var Profiler = require('step-profiler'); /** diff --git a/lib/cartodb/stats/reporter/renderer.js b/lib/cartodb/stats/reporter/renderer.js index 18545202..60899918 100644 --- a/lib/cartodb/stats/reporter/renderer.js +++ b/lib/cartodb/stats/reporter/renderer.js @@ -1,3 +1,5 @@ +'use strict'; + // - Reports stats about: // * Total number of renderers // * For mapnik renderers: diff --git a/lib/cartodb/stats/timer.js b/lib/cartodb/stats/timer.js index 0ef725ab..f15c423a 100644 --- a/lib/cartodb/stats/timer.js +++ b/lib/cartodb/stats/timer.js @@ -1,3 +1,5 @@ +'use strict'; + function Timer() { this.times = {}; } diff --git a/lib/cartodb/utils/database-params.js b/lib/cartodb/utils/database-params.js index a2176eaf..425b7616 100644 --- a/lib/cartodb/utils/database-params.js +++ b/lib/cartodb/utils/database-params.js @@ -1,3 +1,5 @@ +'use strict'; + module.exports = function getDatabaseConnectionParams (params) { const dbParams = {}; diff --git a/lib/cartodb/utils/date-wrapper.js b/lib/cartodb/utils/date-wrapper.js index 3d458978..4cf4fd31 100644 --- a/lib/cartodb/utils/date-wrapper.js +++ b/lib/cartodb/utils/date-wrapper.js @@ -1,3 +1,5 @@ +'use strict'; + const DATE_OIDS = Object.freeze({ 1082: 'DATE', 1083: 'TIME', diff --git a/lib/cartodb/utils/json-replacer.js b/lib/cartodb/utils/json-replacer.js index cccac1f6..7ec959b3 100644 --- a/lib/cartodb/utils/json-replacer.js +++ b/lib/cartodb/utils/json-replacer.js @@ -1,3 +1,5 @@ +'use strict'; + module.exports = function jsonReplacerFactory () { // Fix: https://github.com/CartoDB/Windshaft-cartodb/issues/705 // See: http://expressjs.com/en/4x/api.html#app.set diff --git a/lib/cartodb/utils/layergroup-metadata.js b/lib/cartodb/utils/layergroup-metadata.js index ee2e78c4..1a62f701 100644 --- a/lib/cartodb/utils/layergroup-metadata.js +++ b/lib/cartodb/utils/layergroup-metadata.js @@ -1,3 +1,5 @@ +'use strict'; + const dateWrapper = require('./date-wrapper'); const querystring = require('querystring'); diff --git a/lib/cartodb/utils/overviews_query_rewriter.js b/lib/cartodb/utils/overviews_query_rewriter.js index 8dcc2f08..cf61b070 100644 --- a/lib/cartodb/utils/overviews_query_rewriter.js +++ b/lib/cartodb/utils/overviews_query_rewriter.js @@ -1,3 +1,5 @@ +'use strict'; + var _ = require('underscore'); var TableNameParser = require('./table_name_parser'); diff --git a/lib/cartodb/utils/query-utils.js b/lib/cartodb/utils/query-utils.js index 633a02a4..2fc00c5a 100644 --- a/lib/cartodb/utils/query-utils.js +++ b/lib/cartodb/utils/query-utils.js @@ -1,3 +1,5 @@ +'use strict'; + const SubstitutionTokens = require('./substitution-tokens'); function prepareQuery(sql) { @@ -211,4 +213,3 @@ module.exports.queryPromise = queryPromise; module.exports.getQueryLimited = getQueryLimited; module.exports.substituteDummyTokens = substituteDummyTokens; module.exports.subsituteTokensForZoom = subsituteTokensForZoom; - diff --git a/lib/cartodb/utils/substitution-tokens.js b/lib/cartodb/utils/substitution-tokens.js index 5905fa4d..b6bd3cf4 100644 --- a/lib/cartodb/utils/substitution-tokens.js +++ b/lib/cartodb/utils/substitution-tokens.js @@ -1,3 +1,5 @@ +'use strict'; + var SUBSTITUTION_TOKENS = { bbox: /!bbox!/g, scale_denominator: /!scale_denominator!/g, diff --git a/lib/cartodb/utils/table_name_parser.js b/lib/cartodb/utils/table_name_parser.js index f71c3f34..f2550ad6 100644 --- a/lib/cartodb/utils/table_name_parser.js +++ b/lib/cartodb/utils/table_name_parser.js @@ -1,3 +1,5 @@ +'use strict'; + // Quote an PostgreSQL identifier if ncecessary function quote_identifier_if_needed(txt) { if ( txt && !txt.match(/^[a-z_][a-z_0-9]*$/)) {