@brouwervos/sdk
Advanced tools
Comparing version 1.0.12 to 1.0.13
@@ -202,2 +202,5 @@ /// <reference types="node" /> | ||
create: (companyId: string, body: PaymentCreation) => Promise<PaymentType>; | ||
retrieveAll: (companyId: string, { ids }: { | ||
ids?: string[] | undefined; | ||
}) => Promise<PaymentType[]>; | ||
retrieve: (companyId: string, id: string) => Promise<PaymentType>; | ||
@@ -204,0 +207,0 @@ }; |
@@ -353,2 +353,3 @@ import jsonwebtoken from "jsonwebtoken"; | ||
issuer: this.url, | ||
expiresIn: '14 days', | ||
subject: this.partner_id, | ||
@@ -425,2 +426,15 @@ audience: 'brouwervos.nl/accounts', | ||
}, | ||
retrieveAll: async (companyId, { ids }) => { | ||
const searchParams = new URLSearchParams(); | ||
if (ids) | ||
for (const id of ids) | ||
searchParams.append("payments", id); | ||
const result = await this.requestPartner(`${url}/v1/partners/@me/companies/${encodeURIComponent(companyId)}/payments?${searchParams.toString()}`, { | ||
method: 'GET', | ||
}); | ||
const json = (await result.json()); | ||
if (json.error) | ||
throw new Error(json.error_description); | ||
return json; | ||
}, | ||
retrieve: async (companyId, id) => { | ||
@@ -427,0 +441,0 @@ const result = await this.requestPartner(`${url}/v1/partners/@me/companies/${encodeURIComponent(companyId)}/payments/${encodeURIComponent(id)}`, { |
{ | ||
"name": "@brouwervos/sdk", | ||
"version": "1.0.12", | ||
"version": "1.0.13", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
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
67850
1252