@foxiko/client
Advanced tools
Comparing version 1.0.35 to 1.0.36
@@ -44,2 +44,18 @@ const {Invoice, InvoiceItem} = require("../entities/Invoice"); | ||
async all(id) { | ||
const data = await this.client.request() | ||
.url(FINANCE.INVOICE.ALL) | ||
.header("x-finance-account-id", this.#accountId) | ||
.responseType().json() | ||
.send(); | ||
if(data['error']) { | ||
throw data; | ||
} | ||
return data.map(e => { | ||
let invoice = new Invoice(e); | ||
invoice._handler(this); | ||
return invoice; | ||
}); | ||
} | ||
async create(invoice) { | ||
@@ -46,0 +62,0 @@ if(!(invoice instanceof Invoice)) { |
@@ -13,2 +13,3 @@ const schema = process.env['LOCAL'] === "true" ? "http" : "https"; | ||
GET: (id) => `${schema}://${domain}/${version}/finance/invoice/${id}/get`, | ||
ALL: `${schema}://${domain}/${version}/finance/invoice/all`, | ||
GET_PDF: invoice_id => `${schema}://${domain}/${version}/finance/invoice/${invoice_id}/pdf`, | ||
@@ -15,0 +16,0 @@ CREATE: `${schema}://${domain}/${version}/finance/invoice/create`, |
{ | ||
"name": "@foxiko/client", | ||
"version": "1.0.35", | ||
"version": "1.0.36", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
142536
2506