fakturoid-js
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -1,2 +0,2 @@ | ||
import { Method } from 'axios'; | ||
import { Method, ResponseType } from 'axios'; | ||
export default class ApiEntity { | ||
@@ -15,7 +15,8 @@ protected readonly _endpoint: string; | ||
}, _email: string, _token: string); | ||
protected _request<TRequestBody, TResponseBody>({ method, path, data, }: { | ||
protected _request<TRequestBody, TResponseBody>({ method, path, data, responseType }: { | ||
method: Method; | ||
path: string; | ||
data?: TRequestBody; | ||
responseType?: ResponseType; | ||
}): Promise<TResponseBody>; | ||
} |
@@ -16,3 +16,3 @@ "use strict"; | ||
} | ||
_request({ method, path, data, }) { | ||
_request({ method, path, data, responseType }) { | ||
return axios_1.default({ | ||
@@ -24,5 +24,6 @@ method, | ||
'User-Agent': this._userAgentHeader, | ||
'Authorization': 'Basic ' + new Buffer(this._email + ':' + this._token).toString('base64'), | ||
'Authorization': 'Basic ' + Buffer.from(this._email + ':' + this._token).toString('base64'), | ||
'Content-type': 'application/json' | ||
} | ||
}, | ||
responseType | ||
}) | ||
@@ -29,0 +30,0 @@ .then((response) => { |
@@ -34,2 +34,3 @@ "use strict"; | ||
path: args.path, | ||
responseType: 'arraybuffer' | ||
}); | ||
@@ -36,0 +37,0 @@ }; |
{ | ||
"name": "fakturoid-js", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Fakturoid API v2 TypeScript implementation", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
14129
350