diff --git a/tools/towiki.js b/tools/towiki.js new file mode 100644 index 0000000..2c50ce0 --- /dev/null +++ b/tools/towiki.js @@ -0,0 +1,18 @@ + +var es = require('./lib/endpoints.json') + +var out = [] +out.push(['', 'API resource', 'Lib function name', 'HTTP method', ''].join('|')) +out.push('|---|---|---|') +Object.keys(es.methods).forEach(function(e){ + var m = es.methods[e] + Object.keys(m).forEach(function(r){ + out.push(['', e + r, m[r].resource, m[r].method.toUpperCase(), ''].join('|')) + }) +}) + +Object.keys(es.authentication).forEach(function(e){ + out.push(['', e, es.authentication[e], 'POST', ''].join('|')) +}) + +console.log(out.join('\n'))