@equitysim/trkd-client
Advanced tools
Comparing version 0.2.22 to 0.2.23
{ | ||
"name": "@equitysim/trkd-client", | ||
"version": "0.2.22", | ||
"version": "0.2.23", | ||
"description": "REST Client for TRKD API", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -146,2 +146,3 @@ # TRKD Client | ||
| redisConnection | null | object | redis or ioredis connection | ||
| log | true | boolean | log requests by path to console | ||
@@ -148,0 +149,0 @@ # Formatting |
@@ -17,2 +17,3 @@ import fetch from 'node-fetch' | ||
* @param {?object<redisConnection>} options.redisConnection - redis|ioredis | ||
* @param {?boolean} options.log - log requests defaults to true | ||
*/ | ||
@@ -25,2 +26,3 @@ static init(options) { | ||
TRKDClient._serviceAccount.password = options.password | ||
TRKDClient._log = options.log === undefined ? true : options.log | ||
TRKDClient._isInitialized = true | ||
@@ -115,2 +117,3 @@ } | ||
const execCall = async () => { | ||
if (TRKDClient._log) console.log(`[trkd-client#request] ${path}`) | ||
const res = await fetch(`${this.host}${path}`, { | ||
@@ -117,0 +120,0 @@ method: 'POST', |
51819
1603
183