Socket
Socket
Sign inDemoInstall

amatino

Package Overview
Dependencies
0
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.14 to 0.0.15

2

package.json
{
"name": "amatino",
"version": "0.0.14",
"version": "0.0.15",
"description": "Javascript Node.js bindings library for the Amatino API - Double entry accounting as a service",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -11,3 +11,3 @@ /*

const API_HOSTNAME = "api.amatino.io"
const USER_AGENT = 'Amatino Node.js Library 0.0.13';
const USER_AGENT = 'Amatino Node.js Library 0.0.15';
const HEADER_SIGNATURE_KEY = 'X-Signature';

@@ -19,2 +19,3 @@ const HEADER_SESSION_KEY = 'X-Session-ID';

class _ApiRequest {

@@ -35,5 +36,5 @@

if (urlParameters === null) {
fullPathCalc = path;
fullPathCalc = path;
} else {
fullPathCalc = path + urlParameters;
fullPathCalc = path + urlParameters;
}

@@ -43,35 +44,35 @@ const fullPath = fullPathCalc;

const requestOptions = {
'hostname': API_HOSTNAME,
'method': method,
'path': fullPath,
'headers': headers,
'timeout': TIMEOUT_MILLISECONDS
'hostname': API_HOSTNAME,
'method': method,
'path': fullPath,
'headers': headers,
'timeout': TIMEOUT_MILLISECONDS
}
const request = HTTPS.request(requestOptions, (response) => {
response.setEncoding('utf8');
let responseBody = '';
response.on('data', (chunk) => {
responseBody += chunk;
response.setEncoding('utf8');
let responseBody = '';
response.on('data', (chunk) => {
responseBody += chunk;
});
response.on('end', () => {
if (response.statusCode != 200) {
const code = response.statusCode;
const errorDescription = 'Code: ' + code + ', data: ';
const error = Error(errorDescription + responseBody);
this._callback(error, null);
return;
}
let responseJson = null;
try {
responseJson = jsonParse(responseBody);
} catch (error) {
console.warn(error);
const errorDescription = 'JSON parse failed. Body: ';
const amError = Error(errorDescription + responseBody);
this._callback(amError, null);
return;
}
this._callback(null, responseJson);
});
response.on('end', () => {
if (response.statusCode != 200) {
const code = response.statusCode;
const errorDescription = 'Code: ' + code + ', data: ';
const error = Error(errorDescription + responseBody);
this._callback(error, null);
return;
}
let responseJson = null;
try {
responseJson = jsonParse(responseBody);
} catch (error) {
console.warn(error);
const errorDescription = 'JSON parse failed. Body: ';
const amError = Error(errorDescription + responseBody);
this._callback(amError, null);
return;
}
this._callback(null, responseJson);
});
});

@@ -78,0 +79,0 @@

@@ -69,8 +69,3 @@ /*

const requestTime = Math.floor(new Date() / 1000);
let message = null;
if (!bodyData) {
message = requestTime + path;
} else {
message = requestTime + path + JSON.stringify(bodyData);
}
const message = requestTime + path;

@@ -77,0 +72,0 @@ const hmac = CRYPTO.createHmac(SIGNATURE_HASH, this._apiKey);

@@ -11,14 +11,11 @@ const filesystem = require('fs');

const requiredMajor = Number(requiredVersion.split('.')[0]);
const requiredMinor = Number(requiredVersion.split('.')[1]);
const requiredMajor = requiredVersion.split('.')[0];
const requiredMinor = requiredVersion.split('.')[1];
const runningVersion = process.version.split('v')[1];
const runningMajor = Number(runningVersion.split('.')[0]);
const runningMinor = Number(runningVersion.split('.')[1]);
const runningMajor = runningVersion.split('.')[0];
const runningMinor = runningVersion.split('.')[1];
if (runningMajor > requiredMajor) {
process.exit(0);
}
if (runningMajor == requiredMajor) {
if (runningMajor >= requiredMajor) {
if (runningMinor >= requiredMinor) {

@@ -25,0 +22,0 @@ process.exit(0);

@@ -16,24 +16,23 @@ /*

const testSequence = [
new TestAlphaInitialise(),
new TestAlphaCreateEntity(),
new TestAlphaCreateAccount(),
new TestAlphaCreateTransaction(),
new TestEntityOperations(),
new TestAccountOperations(),
new TestTransactionOperations()
new TestAlphaInitialise(),
new TestAlphaCreateEntity(),
new TestAlphaCreateAccount(),
new TestAlphaCreateTransaction(),
new TestEntityOperations(),
new TestAccountOperations(),
new TestTransactionOperations()
]
async function run(sequenceIndex) {
if (sequenceIndex > (testSequence.length - 1)) {
return;
}
const test = testSequence[sequenceIndex];
await test.execute().then( () => {
console.log(test.report());
run(sequenceIndex + 1);
});
if (sequenceIndex > (testSequence.length - 1)) {
return;
}
const test = testSequence[sequenceIndex];
await test.execute().then( () => {
console.log(test.report());
run(sequenceIndex + 1);
});
}
run(0);
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc