From 71d5e5f15081fa7fd240049539af616a926d7b2d Mon Sep 17 00:00:00 2001 From: Bren Norris Date: Sun, 9 Apr 2017 10:05:31 -0400 Subject: [PATCH 1/3] search now accepts a tilda to list all contents of the local package list --- lib/search.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/search.js b/lib/search.js index 27d46b1bd..b21fd0dcb 100644 --- a/lib/search.js +++ b/lib/search.js @@ -12,7 +12,9 @@ function Search() { } Search.prototype.query = function(q) { - return this.index.search(q) + return q === '~' + ? this.storage.config.localList.get().map( function( package ){ return { ref: package, score: 1 }; } ) + : this.index.search(q); } Search.prototype.add = function(package) { @@ -45,4 +47,3 @@ Search.prototype.configureStorage = function(storage) { } module.exports = Search() - From f1ff7d0eaf7b73829167cc9bfb57d5eda7d457eb Mon Sep 17 00:00:00 2001 From: Juan Picado Date: Tue, 11 Apr 2017 21:53:21 +0200 Subject: [PATCH 2/3] Increase verbose on notify request, helps #144 --- lib/notify.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/notify.js b/lib/notify.js index 5482b15e9..9faceeb7f 100644 --- a/lib/notify.js +++ b/lib/notify.js @@ -1,5 +1,6 @@ var Handlebars = require('handlebars') var request = require('request') +var Logger = require('./logger') module.exports.notify = function(metadata, config) { @@ -18,11 +19,20 @@ module.exports.notify = function(metadata, config) { options.method = config.notify.method; - if(config.notify.endpoint) { + if (config.notify.endpoint) { options.url = config.notify.endpoint } - request(options); + request(options, function(err, response, body) { + if (err) { + Logger.logger.error( { err: err }, ' notify error: @{err.message}' ); + } else { + Logger.logger.info({ content: content}, 'A notification has been shipped: @{content}') + if (body) { + Logger.logger.debug( { body: body }, ' body: @{body}' ); + } + } + }); } } From 94f4cd2be12d07023359a3097dd526e4b7b6b754 Mon Sep 17 00:00:00 2001 From: Bren Norris Date: Tue, 11 Apr 2017 20:17:24 -0400 Subject: [PATCH 3/3] wildcarded searches now use asterisk, not tilda --- lib/search.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/search.js b/lib/search.js index b21fd0dcb..6bed026da 100644 --- a/lib/search.js +++ b/lib/search.js @@ -12,7 +12,7 @@ function Search() { } Search.prototype.query = function(q) { - return q === '~' + return q === '*' ? this.storage.config.localList.get().map( function( package ){ return { ref: package, score: 1 }; } ) : this.index.search(q); }