From 2f218740c6b971944ec114bd3722205728b3f093 Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Thu, 9 Mar 2017 23:17:40 +0000 Subject: [PATCH] update What3Words node to latest library and fix credentials issue closes #285 --- parsers/what3words/package.json | 4 +-- parsers/what3words/w3w.tgz | Bin 15483 -> 0 bytes parsers/what3words/what3words.html | 36 ++++------------------- parsers/what3words/what3words.js | 44 +++-------------------------- 4 files changed, 11 insertions(+), 73 deletions(-) delete mode 100644 parsers/what3words/w3w.tgz diff --git a/parsers/what3words/package.json b/parsers/what3words/package.json index 360cbae7..6d50f509 100644 --- a/parsers/what3words/package.json +++ b/parsers/what3words/package.json @@ -1,9 +1,9 @@ { "name" : "node-red-node-what3words", - "version" : "0.0.4", + "version" : "0.0.5", "description" : "A Node-RED node to convert locations to/from what3words", "dependencies" : { - "geo.what3words" : "0.0.2" + "geo.what3words" : "^2.0.0" }, "repository" : { "type":"git", diff --git a/parsers/what3words/w3w.tgz b/parsers/what3words/w3w.tgz deleted file mode 100644 index 7c5bc96c67d1888f730f12faaded27a543e391e1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15483 zcmV->JcPp^iwFqH3_Mi;19vlbE_7jX0PTGTSQJUqFd`<5m_5_Dq6C)(mJEVqMUn!F zf#9$^yNqmd0~x`1=5&ZTAm*HN;7q5YqL?Fk22{kXnEAVVW_D)@o)_Nx-v9fY=bl%# zr@Okks=B(Wx~5*4Tu4|c389q?{*e@qtL>8HN}9ceu-+=q|8f4Oab&oZ;J9*X5(EyHlSn94 zq+A9%A)x>*LP8}_k_t7|>V<{CF=2kb7#xhL6gWnmqJa2|Ni_hd zQA)ty@oKd~D1neGRbZ*stXaWq5>i0O zRB#F}unXb|FiQfFLL)U)OE=KW8W+vgy@2b2bHP9K7Nq+D_7x`s%!O;z@p2^^L2<ijgaCbT%~{@hT|!oi84aXBjcoSnR*le1c37b6nJu_m?9i5{3f%b zWbQRQQL-qR7uFNU;+2HRJ*t`sqB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;jh9i;o@oJ$4ODN-SaNLf|I0%Ar4Lx}+6} zZXM9g4CNK-iwoeKQm#;v&^$*A76IvkU6B0gG%hP%N<|x0Dqs`A;yOh zPn#8LVQ#X30IAs_0~sNfkihy95EfkRZ8ujhl&g*W{Gq&?Q-%VJ=}X8sWY8hx#4sMA zy|-YdRKpAemBlwoG$8G%cYMI048t-Bi6*8a0*JM^6c_8q@Zo4CB|w)PfJ!Oof^48W z3G>J4s|0AkP%&M2Ax8scG&GF40lZNE4%8o9grbeq{G*k;IqnXLl ztL%t@`8V&x8LZ&4C2~q&#d5h2e%-)|9VWnhd4&RpQ9@`FXdvPuoRnyk)M|F67?jq2DM;=JsSKu;=mKICStSham^@BGN1>42Vhz;}w0xtOVeCqYk$awW9{L-b?;)~yd^w8$i^+YqhIO<#+kATHeu6{${*B7Bjh zqq{}XX>?trh$RMeOc?r1q=?ebaKlsk9nnUlrHzmf0e6KO0gDw>6FSG0QlyC(<628a z-FDU}mAcz9I&utjGVscwvq}X~xmDxFaVfO1p<59842kvCJ!8x#v80h@HfnL91lTXc x7oMxtrNRA3f&KCPcz!%To*&PT=g0Ho`SJXCemp;(AJ2C_{|}cIV^;v60046ZX&e9m diff --git a/parsers/what3words/what3words.html b/parsers/what3words/what3words.html index 1cd1ab48..fbcd342f 100644 --- a/parsers/what3words/what3words.html +++ b/parsers/what3words/what3words.html @@ -1,8 +1,8 @@ diff --git a/parsers/what3words/what3words.js b/parsers/what3words/what3words.js index 8684bb8a..ea3c7af1 100644 --- a/parsers/what3words/what3words.js +++ b/parsers/what3words/what3words.js @@ -6,11 +6,9 @@ module.exports = function(RED) { var what3wordsNode = function(n) { RED.nodes.createNode(this, n); this.lang = n.lang || "en"; - var credentials = RED.nodes.getCredentials(n.id); - if ((credentials) && (credentials.hasOwnProperty("pushkey"))) { this.pushkey = credentials.pushkey; } - else { this.error("No what3words API key set"); } - this.w3w = new What3Words(this.pushkey); var node = this; + //if ( !node.credentials.apikey ) { this.error("No what3words API key set"); } + this.w3w = new What3Words(node.credentials.apikey); var w1 = /^\*\w{6,31}$/; var w3 = /^\w+\.\w+\.\w+$/; this.on("input", function(msg) { @@ -69,41 +67,7 @@ module.exports = function(RED) { else { node.warn("No useable data found. See info."); } }); } - RED.nodes.registerType("what3words", what3wordsNode); - - var querystring = require('querystring'); - - RED.httpAdmin.get('/what3words/:id', RED.auth.needsPermission('what3words.read'), function(req, res) { - var credentials = RED.nodes.getCredentials(req.params.id); - if (credentials) { - res.send(JSON.stringify({hasPassword:(credentials.pushkey && credentials.pushkey !== "")})); - } - else { - res.send(JSON.stringify({})); - } - }); - - RED.httpAdmin.delete('/what3words/:id', RED.auth.needsPermission('what3words.write'), function(req, res) { - RED.nodes.deleteCredentials(req.params.id); - res.send(200); - }); - - RED.httpAdmin.post('/what3words/:id', RED.auth.needsPermission('what3words.write'), function(req, res) { - var body = ""; - req.on('data', function(chunk) { - body += chunk; - }); - req.on('end', function() { - var newCreds = querystring.parse(body); - var credentials = RED.nodes.getCredentials(req.params.id) || {}; - if (newCreds.pushkey === "") { - delete credentials.pushkey; - } - else { - credentials.pushkey = newCreds.pushkey || credentials.pushkey; - } - RED.nodes.addCredentials(req.params.id, credentials); - res.send(200); - }); + RED.nodes.registerType("what3words", what3wordsNode, { + credentials: { apikey: {type: "password"} } }); }