-
-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from tiagosiebler/feat/axios
Replace deprecated `request` with `axios`
- Loading branch information
Showing
14 changed files
with
1,111 additions
and
455 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
module.exports = { | ||
env: { | ||
es6: true, | ||
node: true, | ||
}, | ||
extends: ['eslint:recommended'], | ||
parserOptions: { | ||
sourceType: 'module', | ||
ecmaVersion: 9 | ||
}, | ||
|
||
plugins: [], | ||
rules: { | ||
'array-bracket-spacing': ['error', 'never'], | ||
indent: ['warn', 2], | ||
'linebreak-style': ['error', 'unix'], | ||
'lines-between-class-members': ['warn', 'always'], | ||
semi: ['error', 'always'], | ||
'new-cap': 'off', | ||
'no-console': 'off', | ||
'no-debugger': 'off', | ||
'no-mixed-spaces-and-tabs': 2, | ||
'no-use-before-define': [2, 'nofunc'], | ||
'no-unreachable': ['warn'], | ||
'no-unused-vars': ['warn'], | ||
'no-extra-parens': ['off'], | ||
'no-mixed-operators': ['off'], | ||
quotes: [2, 'single', 'avoid-escape'], | ||
'block-scoped-var': 2, | ||
'brace-style': [2, '1tbs', { allowSingleLine: true }], | ||
'computed-property-spacing': [2, 'never'], | ||
'keyword-spacing': 2, | ||
'space-unary-ops': 2, | ||
'max-len': ['warn', { 'code': 140 }] | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v12.18.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
const RestClient = require('./lib/rest-client.js'); | ||
const WebsocketClient = require('./lib/websocket-client.js'); | ||
const DefaultLogger = require('./lib/logger.js'); | ||
const RestClient = require('./lib/rest-client'); | ||
const WebsocketClient = require('./lib/websocket-client'); | ||
const DefaultLogger = require('./lib/logger'); | ||
|
||
module.exports = { | ||
RestClient, | ||
WebsocketClient, | ||
DefaultLogger | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "ES6", | ||
"module": "commonjs" | ||
}, | ||
"exclude": [ | ||
"node_modules", | ||
"**/node_modules/*", | ||
"coverage" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
|
||
module.exports = { | ||
silly: function() {console.log(arguments)}, | ||
debug: function() {console.log(arguments)}, | ||
notice: function() {console.log(arguments)}, | ||
info: function() {console.info(arguments)}, | ||
warning: function() {console.warn(arguments)}, | ||
error: function() {console.error(arguments)}, | ||
} | ||
silly: function() {console.log(arguments);}, | ||
debug: function() {console.log(arguments);}, | ||
notice: function() {console.log(arguments);}, | ||
info: function() {console.info(arguments);}, | ||
warning: function() {console.warn(arguments);}, | ||
error: function() {console.error(arguments);}, | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
const { createHmac } = require('crypto'); | ||
|
||
module.exports = { | ||
signMessage(message, secret) { | ||
return createHmac('sha256', secret) | ||
.update(message) | ||
.digest('hex'); | ||
}, | ||
serializeParams(params, strict_validation) { | ||
return Object.keys(params) | ||
.sort() | ||
.map(key => { | ||
const value = params[key]; | ||
if (strict_validation === true && typeof value === 'undefined') { | ||
throw new Error('Failed to sign API request due to undefined parameter'); | ||
} | ||
return `${key}=${value}`; | ||
}) | ||
.join('&'); | ||
} | ||
}; |
Oops, something went wrong.