Skip to content

Commit 011e410

Browse files
authored
Merge pull request #2 from oxygens/master
Minor changes.
2 parents 2ce7656 + 5f4942e commit 011e410

File tree

12 files changed

+129
-65
lines changed

12 files changed

+129
-65
lines changed

.babelrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

builds/browser/es5/jsonrpc.js

Lines changed: 7 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

builds/browser/es5/jsonrpc.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
const objExports = {};
1+
// Do not use const here, webpack/babel issues.
2+
var objExports = {};
23

34
objExports.Client = require("./src/Client");
45
objExports.ClientPluginBase = require("./src/ClientPluginBase");

index_webpack.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
const objExports = {
1+
// Do not use const here, webpack/babel issues.
2+
var objExports = {
23
JSONRPC: require("./index")
34
};
45

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
},
3838
"dependencies": {
3939
"crypto-js": "^3.1.9-1",
40+
"jssha": "^2.2.0",
4041
"node-fetch": "^1.6.3",
41-
"sleep-promise": "2.0.0",
4242
"ws": "^2.2.3"
4343
},
4444
"devDependencies": {
@@ -47,14 +47,15 @@
4747
"babel-eslint": "*",
4848
"babel-loader": "*",
4949
"babel-plugin-async-to-promises": "*",
50-
"babel-plugin-transform-runtime": "*",
50+
"babel-plugin-remove-comments": "*",
5151
"babel-polyfill": "*",
5252
"babel-preset-es2015": "*",
5353
"babel-preset-stage-3": "*",
5454
"babel-runtime": "*",
5555
"eslint": "*",
5656
"eslint-plugin-jsdoc": "*",
5757
"phantom": "^4.0.2",
58-
"webpack": "*"
58+
"webpack": "*",
59+
"sleep-promise": "*"
5960
}
6061
}

src/Plugins/Client/SignatureAdd.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
const JSONRPC = {};
22
JSONRPC.ClientPluginBase = require("../../ClientPluginBase");
33

4+
// const JSSHA = require("jssha");
45
const HMAC_SHA256 = require("crypto-js/hmac-sha256");
56

6-
77
/**
88
* This has purpose at Bigstep (the company which originally created this project).
99
* It is intended to be used only together with Bigstep extending API clients.
@@ -58,6 +58,10 @@ class SignatureAdd extends JSONRPC.ClientPluginBase
5858
*/
5959
async afterJSONEncode(outgoingRequest)
6060
{
61+
/*const sha = new JSSHA("SHA-256", "TEXT");
62+
sha.setHMACKey(this.strAPIKey, "TEXT");
63+
sha.update(outgoingRequest.requestBody);
64+
let strVerifyHash = sha.getHMAC("HEX");*/
6165
let strVerifyHash = HMAC_SHA256(outgoingRequest.requestBody, this.strAPIKey);
6266

6367
if(this.strKeyMetaData !== null)

src/Plugins/Client/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
const objExports = {};
1+
// Do not use const here, webpack/babel issues.
2+
var objExports = {};
23

34
objExports.DebugLogger = require("./DebugLogger");
45
objExports.PrettyBrowserConsoleErrors = require("./PrettyBrowserConsoleErrors");

src/Plugins/Server/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
const objExports = {};
1+
// Do not use const here, webpack/babel issues.
2+
var objExports = {};
23

34
objExports.DebugLogger = require("./DebugLogger");
45
objExports.AuthenticationSkip = require("./AuthenticationSkip");

tests/AllTests.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const url = require("url");
55
const path = require("path");
66
const fs = require("fs");
77

8-
const sleep = require("sleep-promise");
8+
//const sleep = require("sleep-promise");
99

1010
const Phantom = require("phantom");
1111

@@ -222,6 +222,7 @@ class AllTests
222222
(
223223
objParsedURL.pathname.substr(0, "/tests/".length) === "/tests/"
224224
|| objParsedURL.pathname.substr(0, "/builds/".length) === "/builds/"
225+
|| objParsedURL.pathname.substr(0, "/node_modules/".length) === "/node_modules/"
225226
)
226227
&& incomingRequest.method === "GET"
227228
&& !objParsedURL.pathname.includes("..")
@@ -236,6 +237,8 @@ class AllTests
236237
}
237238
else if(url.parse(incomingRequest.url).pathname.substr(0, 4) !== "/api")
238239
{
240+
console.error("[" + process.pid + "] Could not find static HTTP file: " + strFilePath);
241+
239242
serverResponse.statusCode = 404;
240243
serverResponse.end();
241244
}
@@ -901,7 +904,7 @@ class AllTests
901904

902905
console.log(
903906
await phantomPage.evaluate(
904-
function () {
907+
function() {
905908
return window.arrErrors;
906909
}
907910
)
@@ -923,7 +926,7 @@ class AllTests
923926
//phantom.process.stdout.pipe(process.stdout);
924927
//phantom.process.stderr.pipe(process.stderr);
925928

926-
const strContent = await phantomPage.property("content");
929+
//const strContent = await phantomPage.property("content");
927930
//console.log(strContent);
928931

929932

0 commit comments

Comments
 (0)