Browse Source

feat: Merge pull request #1111 from pelias/drop-nodejs-4-add-8

Drop Node.js 4 support, add Node.js 8 support
pull/1094/merge
Julian Simioni 7 years ago committed by GitHub
parent
commit
15c996474e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      .travis.yml
  2. 1
      controller/markdownToHtml.js
  3. 2
      controller/place.js
  4. 2
      controller/search.js
  5. 1
      helper/debug.js
  6. 2
      helper/fieldValue.js
  7. 1
      helper/geojsonify.js
  8. 2
      helper/geojsonify_place_details.js
  9. 2
      helper/stackTraceLine.js
  10. 1
      middleware/404.js
  11. 2
      middleware/access_log.js
  12. 1
      middleware/changeLanguage.js
  13. 2
      middleware/confidenceScoreFallback.js
  14. 1
      middleware/cors.js
  15. 1
      middleware/jsonp.js
  16. 2
      middleware/normalizeParentIds.js
  17. 1
      middleware/options.js
  18. 2
      middleware/renamePlacenames.js
  19. 1
      middleware/requestLanguage.js
  20. 2
      package.json
  21. 2
      query/autocomplete.js
  22. 1
      query/autocomplete_defaults.js
  23. 2
      query/reverse.js
  24. 1
      query/reverse_defaults.js
  25. 2
      query/search.js
  26. 1
      query/search_defaults.js
  27. 2
      query/search_original.js
  28. 1
      query/text_parser_addressit.js
  29. 1
      query/view/boost_exact_matches.js
  30. 1
      query/view/focus_selected_layers.js
  31. 1
      query/view/ngrams_last_token_only.js
  32. 1
      query/view/ngrams_strict.js
  33. 1
      query/view/phrase_first_tokens_only.js
  34. 1
      query/view/pop_subquery.js
  35. 1
      sanitizer/_single_scalar_parameters.js
  36. 1
      sanitizer/_tokenizer.js
  37. 1
      sanitizer/place.js
  38. 1
      sanitizer/reverse.js
  39. 1
      sanitizer/sanitizeAll.js
  40. 1
      sanitizer/wrap.js
  41. 1
      schema.js
  42. 2
      service/configurations/Interpolation.js
  43. 2
      service/configurations/Language.js
  44. 2
      service/configurations/Libpostal.js
  45. 2
      service/configurations/PlaceHolder.js
  46. 2
      service/configurations/PointInPolygon.js
  47. 1
      service/mget.js
  48. 1
      service/search.js
  49. 1
      test/ciao_test_data.js
  50. 2
      test/unit/app.js
  51. 2
      test/unit/controller/coarse_reverse.js
  52. 1
      test/unit/controller/index.js
  53. 2
      test/unit/controller/libpostal.js
  54. 2
      test/unit/controller/place.js
  55. 2
      test/unit/controller/placeholder.js
  56. 2
      test/unit/controller/predicates/has_parsed_text_properties.js
  57. 2
      test/unit/controller/predicates/has_request_errors.js
  58. 2
      test/unit/controller/predicates/has_request_parameter.js
  59. 2
      test/unit/controller/predicates/has_response_data.js
  60. 2
      test/unit/controller/predicates/has_results_at_layers.js
  61. 2
      test/unit/controller/predicates/is_addressit_parse.js
  62. 2
      test/unit/controller/predicates/is_admin_only_analysis.js
  63. 2
      test/unit/controller/predicates/is_coarse_reverse.js
  64. 2
      test/unit/controller/predicates/is_only_non_admin_layers.js
  65. 2
      test/unit/controller/predicates/is_request_sources_only_whosonfirst.js
  66. 2
      test/unit/controller/search.js
  67. 2
      test/unit/controller/search_with_ids.js
  68. 2
      test/unit/controller/structured_libpostal.js
  69. 1
      test/unit/fixture/autocomplete_boundary_country.js
  70. 1
      test/unit/fixture/autocomplete_linguistic_final_token.js
  71. 1
      test/unit/fixture/autocomplete_linguistic_focus.js
  72. 1
      test/unit/fixture/autocomplete_linguistic_focus_null_island.js
  73. 1
      test/unit/fixture/autocomplete_linguistic_multiple_tokens.js
  74. 1
      test/unit/fixture/autocomplete_linguistic_only.js
  75. 1
      test/unit/fixture/autocomplete_linguistic_with_admin.js
  76. 1
      test/unit/fixture/autocomplete_single_character_street.js
  77. 1
      test/unit/fixture/autocomplete_with_layer_filtering.js
  78. 1
      test/unit/fixture/autocomplete_with_source_filtering.js
  79. 1
      test/unit/fixture/search_boundary_country_original.js
  80. 1
      test/unit/fixture/search_linguistic_bbox_original.js
  81. 1
      test/unit/fixture/search_linguistic_focus_bbox_original.js
  82. 1
      test/unit/fixture/search_linguistic_focus_null_island_original.js
  83. 1
      test/unit/fixture/search_linguistic_focus_original.js
  84. 1
      test/unit/fixture/search_linguistic_only_original.js
  85. 1
      test/unit/fixture/search_partial_address_original.js
  86. 1
      test/unit/fixture/search_regions_address_original.js
  87. 1
      test/unit/fixture/search_with_source_filtering_original.js
  88. 2
      test/unit/middleware/changeLanguage.js
  89. 2
      test/unit/middleware/interpolate.js
  90. 1
      test/unit/middleware/localNamingConventions.js
  91. 1
      test/unit/middleware/requestLanguage.js
  92. 2
      test/unit/query/MockQuery.js
  93. 1
      test/unit/query/autocomplete_defaults.js
  94. 1
      test/unit/query/reverse_defaults.js
  95. 1
      test/unit/query/search_defaults.js
  96. 2
      test/unit/sanitizer/_geo_reverse.js
  97. 1
      test/unit/sanitizer/wrap.js
  98. 2
      test/unit/schema.js

10
.travis.yml

@ -3,21 +3,17 @@ language: node_js
notifications:
email: false
node_js:
- 4
- 6
- 8
matrix:
fast_finish: true
env:
global:
- BUILD_LEADER_ID=2
script: npm run travis
before_install:
- npm i -g npm@^3.0.0
- npm i -g npm
before_script:
- npm prune
after_success:
- npm install -g npx
- npx -p node@8 npm run semantic-release
- npm run semantic-release
branches:
except:
- /^v\d+\.\d+\.\d+$/

1
controller/markdownToHtml.js

@ -1,4 +1,3 @@
var markdown = require('markdown').markdown;
var fs = require('fs');

2
controller/place.js

@ -1,5 +1,3 @@
'use strict';
const _ = require('lodash');
const retry = require('retry');

2
controller/search.js

@ -1,5 +1,3 @@
'use strict';
const _ = require('lodash');
const searchService = require('../service/search');

1
helper/debug.js

@ -1,4 +1,3 @@
'use strict';
const _ = require('lodash');
class Debug {

2
helper/fieldValue.js

@ -1,5 +1,3 @@
'use strict';
const _ = require('lodash');
function getStringValue(property) {

1
helper/geojsonify.js

@ -1,4 +1,3 @@
const GeoJSON = require('geojson');
const extent = require('@mapbox/geojson-extent');
const logger = require('pelias-logger').get('geojsonify');

2
helper/geojsonify_place_details.js

@ -1,5 +1,3 @@
'use strict';
const _ = require('lodash');
const field = require('./fieldValue');

2
helper/stackTraceLine.js

@ -1,5 +1,3 @@
'use strict';
module.exports = () => {
const stack = new Error().stack.split('\n');
let targetLine;

1
middleware/404.js

@ -1,4 +1,3 @@
// handle not found errors
function middleware(req, res) {
res.header('Cache-Control','public');

2
middleware/access_log.js

@ -2,8 +2,6 @@
* Create a middleware that prints access logs via pelias-logger.
*/
'use strict';
var url = require( 'url' );
var _ = require( 'lodash' );

1
middleware/changeLanguage.js

@ -1,4 +1,3 @@
var logger = require( 'pelias-logger' ).get( 'api' );
const _ = require('lodash');

2
middleware/confidenceScoreFallback.js

@ -1,5 +1,3 @@
'use strict';
/**
*
* Basic confidence score should be computed and returned for each item in the results.

1
middleware/cors.js

@ -1,4 +1,3 @@
function middleware(req, res, next){
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Methods', 'GET, OPTIONS');

1
middleware/jsonp.js

@ -1,4 +1,3 @@
function middleware(req, res, next){
// store old json function

2
middleware/normalizeParentIds.js

@ -1,5 +1,3 @@
'use strict';
const logger = require('pelias-logger').get('api');
const Document = require('pelias-model').Document;
const placeTypes = require('../helper/placeTypes');

1
middleware/options.js

@ -1,4 +1,3 @@
/**
this functionality is required by CORS as the browser will send an
HTTP OPTIONS request before performing the CORS request.

2
middleware/renamePlacenames.js

@ -1,5 +1,3 @@
'use strict';
const _ = require('lodash');
const PARENT_PROPS = require('../helper/placeTypes');

1
middleware/requestLanguage.js

@ -1,4 +1,3 @@
const _ = require('lodash');
const logger = require( 'pelias-logger' ).get( 'api' );

2
package.json

@ -35,7 +35,7 @@
"url": "https://github.com/pelias/api/issues"
},
"engines": {
"node": ">=4.0.0"
"node": ">=6.0.0"
},
"dependencies": {
"addressit": "1.5.0",

2
query/autocomplete.js

@ -1,5 +1,3 @@
'use strict';
const peliasQuery = require('pelias-query');
const defaults = require('./autocomplete_defaults');
const textParser = require('./text_parser_addressit');

1
query/autocomplete_defaults.js

@ -1,4 +1,3 @@
var peliasQuery = require('pelias-query');
var _ = require('lodash');

2
query/reverse.js

@ -1,5 +1,3 @@
'use strict';
const peliasQuery = require('pelias-query');
const defaults = require('./reverse_defaults');
const check = require('check-types');

1
query/reverse_defaults.js

@ -1,4 +1,3 @@
var peliasQuery = require('pelias-query');
var _ = require('lodash');

2
query/search.js

@ -1,5 +1,3 @@
'use strict';
const peliasQuery = require('pelias-query');
const defaults = require('./search_defaults');
const textParser = require('./text_parser');

1
query/search_defaults.js

@ -1,4 +1,3 @@
var peliasQuery = require('pelias-query');
var _ = require('lodash');

2
query/search_original.js

@ -1,5 +1,3 @@
'use strict';
const peliasQuery = require('pelias-query');
const defaults = require('./search_defaults');
const textParser = require('./text_parser_addressit');

1
query/text_parser_addressit.js

@ -1,4 +1,3 @@
var logger = require('pelias-logger').get('api');
var placeTypes = require('../helper/placeTypes');

1
query/view/boost_exact_matches.js

@ -1,4 +1,3 @@
var peliasQuery = require('pelias-query'),
searchDefaults = require('../search_defaults');

1
query/view/focus_selected_layers.js

@ -1,4 +1,3 @@
var peliasQuery = require('pelias-query');
/**

1
query/view/ngrams_last_token_only.js

@ -1,4 +1,3 @@
var peliasQuery = require('pelias-query'),
ngrams_strict = require('./ngrams_strict');

1
query/view/ngrams_strict.js

@ -1,4 +1,3 @@
var peliasQuery = require('pelias-query');
/**

1
query/view/phrase_first_tokens_only.js

@ -1,4 +1,3 @@
var peliasQuery = require('pelias-query');
/**

1
query/view/pop_subquery.js

@ -1,4 +1,3 @@
var peliasQuery = require('pelias-query'),
check = require('check-types');

1
sanitizer/_single_scalar_parameters.js

@ -1,4 +1,3 @@
var _ = require('lodash'),
check = require('check-types');

1
sanitizer/_tokenizer.js

@ -1,4 +1,3 @@
var check = require('check-types');
/**

1
sanitizer/place.js

@ -1,4 +1,3 @@
var sanitizeAll = require('../sanitizer/sanitizeAll'),
sanitizers = {
singleScalarParameters: require('../sanitizer/_single_scalar_parameters')(),

1
sanitizer/reverse.js

@ -1,4 +1,3 @@
var type_mapping = require('../helper/type_mapping');
var sanitizeAll = require('../sanitizer/sanitizeAll'),
sanitizers = {

1
sanitizer/sanitizeAll.js

@ -1,4 +1,3 @@
'use strict';
function sanitize( req, sanitizers ){
// init an object to store clean (sanitized) input parameters if not initialized
req.clean = req.clean || {};

1
sanitizer/wrap.js

@ -1,4 +1,3 @@
/**
normalize co-ordinates that lie outside of the normal ranges.

1
schema.js

@ -1,4 +1,3 @@
'use strict';
const Joi = require('joi');

2
service/configurations/Interpolation.js

@ -1,5 +1,3 @@
'use strict';
const url = require('url');
const _ = require('lodash');

2
service/configurations/Language.js

@ -1,5 +1,3 @@
'use strict';
const url = require('url');
const _ = require('lodash');

2
service/configurations/Libpostal.js

@ -1,5 +1,3 @@
'use strict';
const url = require('url');
const ServiceConfiguration = require('pelias-microservice-wrapper').ServiceConfiguration;

2
service/configurations/PlaceHolder.js

@ -1,5 +1,3 @@
'use strict';
const url = require('url');
const _ = require('lodash');

2
service/configurations/PointInPolygon.js

@ -1,5 +1,3 @@
'use strict';
const url = require('url');
const _ = require('lodash');

1
service/mget.js

@ -1,4 +1,3 @@
/**
query must be an array of hashes, structured like so:

1
service/search.js

@ -1,4 +1,3 @@
/**
cmd can be any valid ES query command

1
test/ciao_test_data.js

@ -1,4 +1,3 @@
/**
Test data required by the ciao test suite.

2
test/unit/app.js

@ -1,5 +1,3 @@
'use strict';
const proxyquire = require('proxyquire').noCallThru();
module.exports.tests = {};

2
test/unit/controller/coarse_reverse.js

@ -1,5 +1,3 @@
'use strict';
const setup = require('../../../controller/coarse_reverse');
const proxyquire = require('proxyquire').noCallThru();
const _ = require('lodash');

1
test/unit/controller/index.js

@ -1,4 +1,3 @@
var setup = require('../../../controller/markdownToHtml');
module.exports.tests = {};

2
test/unit/controller/libpostal.js

@ -1,5 +1,3 @@
'use strict';
const proxyquire = require('proxyquire').noCallThru();
const libpostal = require('../../../controller/libpostal');
const _ = require('lodash');

2
test/unit/controller/place.js

@ -1,5 +1,3 @@
'use strict';
const setup = require('../../../controller/place');
const proxyquire = require('proxyquire').noCallThru();

2
test/unit/controller/placeholder.js

@ -1,5 +1,3 @@
'use strict';
const placeholder = require('../../../controller/placeholder');
const proxyquire = require('proxyquire').noCallThru();
const mock_logger = require('pelias-mock-logger');

2
test/unit/controller/predicates/has_parsed_text_properties.js

@ -1,5 +1,3 @@
'use strict';
const _ = require('lodash');
const has_parsed_text_properties = require('../../../../controller/predicates/has_parsed_text_properties');

2
test/unit/controller/predicates/has_request_errors.js

@ -1,5 +1,3 @@
'use strict';
const _ = require('lodash');
const has_request_errors = require('../../../../controller/predicates/has_request_errors');

2
test/unit/controller/predicates/has_request_parameter.js

@ -1,5 +1,3 @@
'use strict';
const _ = require('lodash');
const has_request_parameter = require('../../../../controller/predicates/has_request_parameter');

2
test/unit/controller/predicates/has_response_data.js

@ -1,5 +1,3 @@
'use strict';
const _ = require('lodash');
const has_response_data = require('../../../../controller/predicates/has_response_data');

2
test/unit/controller/predicates/has_results_at_layers.js

@ -1,5 +1,3 @@
'use strict';
const _ = require('lodash');
const has_results_at_layers = require('../../../../controller/predicates/has_results_at_layers');

2
test/unit/controller/predicates/is_addressit_parse.js

@ -1,5 +1,3 @@
'use strict';
const _ = require('lodash');
const is_addressit_parse = require('../../../../controller/predicates/is_addressit_parse');

2
test/unit/controller/predicates/is_admin_only_analysis.js

@ -1,5 +1,3 @@
'use strict';
const _ = require('lodash');
const is_admin_only_analysis = require('../../../../controller/predicates/is_admin_only_analysis');

2
test/unit/controller/predicates/is_coarse_reverse.js

@ -1,5 +1,3 @@
'use strict';
const _ = require('lodash');
const is_coarse_reverse = require('../../../../controller/predicates/is_coarse_reverse');

2
test/unit/controller/predicates/is_only_non_admin_layers.js

@ -1,5 +1,3 @@
'use strict';
const _ = require('lodash');
const is_only_non_admin_layers = require('../../../../controller/predicates/is_only_non_admin_layers');

2
test/unit/controller/predicates/is_request_sources_only_whosonfirst.js

@ -1,5 +1,3 @@
'use strict';
const _ = require('lodash');
const is_request_sources_only_whosonfirst = require('../../../../controller/predicates/is_request_sources_only_whosonfirst');

2
test/unit/controller/search.js

@ -1,5 +1,3 @@
'use strict';
const setup = require('../../../controller/search');
const proxyquire = require('proxyquire').noCallThru();

2
test/unit/controller/search_with_ids.js

@ -1,5 +1,3 @@
'use strict';
const setup = require('../../../controller/search_with_ids');
const proxyquire = require('proxyquire').noCallThru();
const mocklogger = require('pelias-mock-logger');

2
test/unit/controller/structured_libpostal.js

@ -1,5 +1,3 @@
'use strict';
const proxyquire = require('proxyquire').noCallThru();
const libpostal = require('../../../controller/structured_libpostal');
const _ = require('lodash');

1
test/unit/fixture/autocomplete_boundary_country.js

@ -1,4 +1,3 @@
module.exports = {
'query': {
'bool': {

1
test/unit/fixture/autocomplete_linguistic_final_token.js

@ -1,4 +1,3 @@
module.exports = {
'query': {
'bool': {

1
test/unit/fixture/autocomplete_linguistic_focus.js

@ -1,4 +1,3 @@
module.exports = {
'query': {
'bool': {

1
test/unit/fixture/autocomplete_linguistic_focus_null_island.js

@ -1,4 +1,3 @@
module.exports = {
'query': {
'bool': {

1
test/unit/fixture/autocomplete_linguistic_multiple_tokens.js

@ -1,4 +1,3 @@
module.exports = {
'query': {
'bool': {

1
test/unit/fixture/autocomplete_linguistic_only.js

@ -1,4 +1,3 @@
module.exports = {
'query': {
'bool': {

1
test/unit/fixture/autocomplete_linguistic_with_admin.js

@ -1,4 +1,3 @@
module.exports = {
'query': {
'bool': {

1
test/unit/fixture/autocomplete_single_character_street.js

@ -1,4 +1,3 @@
module.exports = {
'query': {
'bool': {

1
test/unit/fixture/autocomplete_with_layer_filtering.js

@ -1,4 +1,3 @@
module.exports = {
'query': {
'bool': {

1
test/unit/fixture/autocomplete_with_source_filtering.js

@ -1,4 +1,3 @@
module.exports = {
'query': {
'bool': {

1
test/unit/fixture/search_boundary_country_original.js

@ -1,4 +1,3 @@
module.exports = {
'query': {
'bool': {

1
test/unit/fixture/search_linguistic_bbox_original.js

@ -1,4 +1,3 @@
module.exports = {
'query': {
'bool': {

1
test/unit/fixture/search_linguistic_focus_bbox_original.js

@ -1,4 +1,3 @@
module.exports = {
'query': {
'bool': {

1
test/unit/fixture/search_linguistic_focus_null_island_original.js

@ -1,4 +1,3 @@
module.exports = {
'query': {
'bool': {

1
test/unit/fixture/search_linguistic_focus_original.js

@ -1,4 +1,3 @@
module.exports = {
'query': {
'bool': {

1
test/unit/fixture/search_linguistic_only_original.js

@ -1,4 +1,3 @@
module.exports = {
'query': {
'bool': {

1
test/unit/fixture/search_partial_address_original.js

@ -1,4 +1,3 @@
var vs = require('../../../query/search_defaults');
module.exports = {

1
test/unit/fixture/search_regions_address_original.js

@ -1,4 +1,3 @@
var vs = require('../../../query/search_defaults');
module.exports = {

1
test/unit/fixture/search_with_source_filtering_original.js

@ -1,4 +1,3 @@
module.exports = {
'query': {
'bool': {

2
test/unit/middleware/changeLanguage.js

@ -1,5 +1,3 @@
'use strict';
const setup = require('../../../middleware/changeLanguage');
const proxyquire = require('proxyquire').noCallThru();
const _ = require('lodash');

2
test/unit/middleware/interpolate.js

@ -1,5 +1,3 @@
'use strict';
const setup = require('../../../middleware/interpolate');
const proxyquire = require('proxyquire').noCallThru();
const _ = require('lodash');

1
test/unit/middleware/localNamingConventions.js

@ -1,4 +1,3 @@
const proxyquire = require('proxyquire');
var customConfig = {

1
test/unit/middleware/requestLanguage.js

@ -1,4 +1,3 @@
var middleware = require('../../../middleware/requestLanguage');
module.exports.tests = {};

2
test/unit/query/MockQuery.js

@ -1,5 +1,3 @@
'use strict';
module.exports = class MockQuery {
constructor() {
this._score_functions = [];

1
test/unit/query/autocomplete_defaults.js

@ -1,4 +1,3 @@
var defaults = require('../../../query/autocomplete_defaults');
module.exports.tests = {};

1
test/unit/query/reverse_defaults.js

@ -1,4 +1,3 @@
var defaults = require('../../../query/reverse_defaults');
module.exports.tests = {};

1
test/unit/query/search_defaults.js

@ -1,4 +1,3 @@
var defaults = require('../../../query/search_defaults');
module.exports.tests = {};

2
test/unit/sanitizer/_geo_reverse.js

@ -1,5 +1,3 @@
'use strict';
const sanitizer = require('../../../sanitizer/_geo_reverse')();
const defaults = require('../../../query/reverse_defaults');

1
test/unit/sanitizer/wrap.js

@ -1,4 +1,3 @@
var wrap = require('../../../sanitizer/wrap');
module.exports.tests = {};

2
test/unit/schema.js

@ -1,5 +1,3 @@
'use strict';
const Joi = require('joi');
const schema = require('../../schema');
const _ = require('lodash');

Loading…
Cancel
Save