diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cb3781f --- /dev/null +++ b/.gitignore @@ -0,0 +1,31 @@ +# Intellij +.idea +*.iml + +# nyc test coverage +.nyc_output + +# Optional npm cache directory +.npm + +# Dependency directories +node_modules/ +jspm_packages/ + +# Typescript v1 declaration files +typings/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +.DS_Store +.*.swp diff --git a/viper-virtual-glitch-connector/index.js b/viper-virtual-glitch-connector/index.js index e13d553..0e0be0c 100755 --- a/viper-virtual-glitch-connector/index.js +++ b/viper-virtual-glitch-connector/index.js @@ -17,7 +17,7 @@ function discoveryRequest(requestId) { } function commandRequest(request) { - let response = new CommandResponse(request.headers.requestId) + let response = new CommandResponse(request.body.headers.requestId) request.body.devices.map(({ externalDeviceId, deviceCookie, commands }) => { const device = response.addDevice(externalDeviceId, deviceCookie); stPartnerHelper.mapSTCommandsToState(device, commands) @@ -40,8 +40,8 @@ function stateRefreshRequest(request) { } function grantCallbackAccess(request) { - console.log("grantCallbackAccess token is:", request.callbackAuthentication.code) - console.log("grantCallbackAccess clientId is:", request.callbackAuthentication.clientId) + console.log("grantCallbackAccess token is:", request.body.callbackAuthentication.code) + console.log("grantCallbackAccess clientId is:", request.body.callbackAuthentication.clientId) return {}; } diff --git a/viper-virtual-glitch-connector/package.json b/viper-virtual-glitch-connector/package.json index 3a59760..6285587 100755 --- a/viper-virtual-glitch-connector/package.json +++ b/viper-virtual-glitch-connector/package.json @@ -14,6 +14,6 @@ "dependencies": { "body-parser": "^1.15.2", "express": "^4.13.4", - "st-schema": "1.0.7" + "st-schema": "^1.0.8" } -} \ No newline at end of file +}