From 6eb7d9bc28788f88c4fe1b6d038c276ba4ba1e6c Mon Sep 17 00:00:00 2001 From: Jonathan Derrough Date: Wed, 11 Dec 2024 19:54:37 +0100 Subject: [PATCH 01/10] fix: Add .prettierrc.json to make double quotes explicit --- .prettierrc.json | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .prettierrc.json diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..1ca87ab --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,3 @@ +{ + "singleQuote": false +} From 5a981d51c9d5b9c231791478292820e13b44c959 Mon Sep 17 00:00:00 2001 From: Jonathan Derrough Date: Wed, 11 Dec 2024 20:23:01 +0100 Subject: [PATCH 02/10] feat: Adds getPaymentMethods --- src/client.test.ts | 12 ++++++++++++ src/client.ts | 18 ++++++++++++++++++ src/urls.ts | 11 +++++++++++ 3 files changed, 41 insertions(+) diff --git a/src/client.test.ts b/src/client.test.ts index a10187a..00ac399 100644 --- a/src/client.test.ts +++ b/src/client.test.ts @@ -10,6 +10,7 @@ import { ModelDocument, ModelDocumentFolder, ModelInvoice, + ModelPaymentMethod, ModelUnity, } from "./interfaces.js"; @@ -93,6 +94,13 @@ test("Get unities", async () => { unities.forEach(assertIsUnity); }); +test("Get payment methods", async () => { + const { objects: paymentMethods } = await sevDeskClient.getPaymentMethods(); + + assert.is(paymentMethods.length > 0, true); + paymentMethods.forEach(assertIsPaymentMethod); +}); + const assertIsInvoice = (invoice: ModelInvoice) => { assert.is(invoice.objectName, "Invoice"); }; @@ -117,4 +125,8 @@ const assertIsUnity = (unity: ModelUnity) => { assert.is(unity.objectName, "Unity"); }; +const assertIsPaymentMethod = (paymentMethod: ModelPaymentMethod) => { + assert.is(paymentMethod.objectName, "PaymentMethod"); +}; + test.run(); diff --git a/src/client.ts b/src/client.ts index 78ddb0d..c660415 100644 --- a/src/client.ts +++ b/src/client.ts @@ -7,6 +7,7 @@ import { ModelDocument, ModelDocumentFolder, ModelInvoice, + ModelPaymentMethod, ModelUnity, } from "./interfaces.js"; import { SevDeskUrls } from "./urls.js"; @@ -228,6 +229,23 @@ export class SevDeskClient { }); } + // ------------------------------------------------------- + // PaymentMethod + // ------------------------------------------------------- + + /** + * Get an overview of all payment methods + */ + async getPaymentMethods( + params: UrlParamsFor<"apiGetPaymentMethodsUrl"> = {} + ) { + const url = this.urls.apiGetPaymentMethodsUrl(params); + + return this.request<{ objects: Array> }>(url, { + method: "GET", + }); + } + // // pending invoices from sevdesk includes also outstanding / due invoices // // we remove them with a filter but you could also include the if you only need everything pending // async getPendingInvoices(options = { includeOutstanding: false }) { diff --git a/src/urls.ts b/src/urls.ts index 1b8b5ae..3ccd3df 100644 --- a/src/urls.ts +++ b/src/urls.ts @@ -120,4 +120,15 @@ export class SevDeskUrls { query, }); } + + // ------------------------------------------------------- + // PaymentMethod + // ------------------------------------------------------- + + apiGetPaymentMethodsUrl({ ...query }: DefaultCollectionQuery & Query = {}) { + return this.apiUrl({ + path: `PaymentMethod`, + query, + }); + } } From 7d9b8a94981730649e7c504615fe2895aff42437 Mon Sep 17 00:00:00 2001 From: Jonathan Derrough Date: Wed, 11 Dec 2024 20:23:45 +0100 Subject: [PATCH 03/10] feat: Adds saveInvoice --- src/client.test.ts | 103 +++++++++++++++++++++++++++++++++++++++++++++ src/client.ts | 15 +++++++ src/tests/env.ts | 5 +++ 3 files changed, 123 insertions(+) diff --git a/src/client.test.ts b/src/client.test.ts index 00ac399..d110f3e 100644 --- a/src/client.test.ts +++ b/src/client.test.ts @@ -47,6 +47,109 @@ test("Get next invoice number", async () => { assert.type(nextInvoiceNumber, "string"); }); +test("Create a new invoice", async () => { + const { objects: invoiceNumber } = await sevDeskClient.getNextInvoiceNumber({ + invoiceType: "RE", + useNextNumber: true, + }); + const { objects: contacts } = await sevDeskClient.getContacts(); + + const { + objects: { invoice }, + } = await sevDeskClient.saveInvoice({ + invoice: { + // id: null, + objectName: "Invoice", + invoiceNumber, + contact: { + id: contacts[0].id, + objectName: "Contact", + }, + contactPerson: { + id: env.CONTACT_PERSON_ID, + objectName: "SevUser", + }, + invoiceDate: "01.01.2022", + header: `Invoice ${invoiceNumber}`, + headText: "header information", + footText: "footer information", + timeToPay: 20, + discount: 0, + address: "name\nstreet\npostCode city", + addressCountry: { + id: 1, + objectName: "StaticCountry", + }, + payDate: "2019-08-24T14:15:22Z", + deliveryDate: "01.01.2022", + deliveryDateUntil: null, + status: "100", + smallSettlement: 0, + taxRate: 0, + taxRule: { + id: "1", + objectName: "TaxRule", + }, + taxText: "Umsatzsteuer 19%", + taxType: "default", + taxSet: null, + paymentMethod: { + id: 21919, + objectName: "PaymentMethod", + }, + sendDate: "01.01.2020", + invoiceType: "RE", + currency: "EUR", + showNet: "1", + sendType: "VPR", + origin: null, + customerInternalNote: null, + propertyIsEInvoice: false, + mapAll: true, + }, + invoicePosSave: [ + { + id: null, + objectName: "InvoicePos", + mapAll: true, + // part: { + // id: 0, + // objectName: 'Part', + // }, + quantity: 1, + price: 100, + name: "Dragonglass", + unity: { + id: 1, + objectName: "Unity", + }, + positionNumber: 0, + text: "string", + discount: 0.1, + taxRate: 19, + priceGross: 100, + priceTax: 0.1, + }, + ], + invoicePosDelete: null, + filename: "string", + discountSave: [ + { + discount: "true", + text: "string", + percentage: true, + value: 0, + objectName: "Discounts", + mapAll: "true", + }, + ], + discountDelete: null, + }); + + console.log(invoice); + assertIsInvoice(invoice); +}); + test("Get document folders", async () => { const { objects: documentFolders } = await sevDeskClient.getDocumentFolders(); diff --git a/src/client.ts b/src/client.ts index c660415..6ebd50e 100644 --- a/src/client.ts +++ b/src/client.ts @@ -113,6 +113,21 @@ export class SevDeskClient { }>(url, { method: "GET" }); } + /** + * Create a new invoice + */ + async saveInvoice(body: unknown) { + const url = this.urls.apiSaveInvoiceUrl(); + + return this.request<{ + objects: { invoice: Required }; + }>(url, { + method: "POST", + body: JSON.stringify(body), + headers: { "Content-Type": "application/json" }, + }); + } + // ------------------------------------------------------- // DocumentFolder // ------------------------------------------------------- diff --git a/src/tests/env.ts b/src/tests/env.ts index b85e50b..b335f7b 100644 --- a/src/tests/env.ts +++ b/src/tests/env.ts @@ -4,3 +4,8 @@ export const TEST_SEVDESK_API_TOKEN = env .get("TEST_SEVDESK_API_TOKEN") .required() .asString(); + +export const CONTACT_PERSON_ID = env + .get("CONTACT_PERSON_ID") + .required() + .asString(); From 287bd03248ee78ee60af0d39f908e3bcf2e0725e Mon Sep 17 00:00:00 2001 From: Jonathan Derrough Date: Thu, 12 Dec 2024 21:12:22 +0100 Subject: [PATCH 04/10] feat: Adds getTags --- src/client.test.ts | 11 +++++++++++ src/client.ts | 16 ++++++++++++++++ src/urls.ts | 11 +++++++++++ 3 files changed, 38 insertions(+) diff --git a/src/client.test.ts b/src/client.test.ts index d110f3e..5f01e94 100644 --- a/src/client.test.ts +++ b/src/client.test.ts @@ -11,6 +11,7 @@ import { ModelDocumentFolder, ModelInvoice, ModelPaymentMethod, + ModelTag, ModelUnity, } from "./interfaces.js"; @@ -204,6 +205,12 @@ test("Get payment methods", async () => { paymentMethods.forEach(assertIsPaymentMethod); }); +test("Get tags", async () => { + const { objects: tags } = await sevDeskClient.getTags(); + + assert.is(tags.length > 0, true); + tags.forEach(assertIsTag); +}); const assertIsInvoice = (invoice: ModelInvoice) => { assert.is(invoice.objectName, "Invoice"); }; @@ -232,4 +239,8 @@ const assertIsPaymentMethod = (paymentMethod: ModelPaymentMethod) => { assert.is(paymentMethod.objectName, "PaymentMethod"); }; +const assertIsTag = (tag: ModelTag) => { + assert.is(tag.objectName, "Tag"); +}; + test.run(); diff --git a/src/client.ts b/src/client.ts index 6ebd50e..17b636f 100644 --- a/src/client.ts +++ b/src/client.ts @@ -8,6 +8,7 @@ import { ModelDocumentFolder, ModelInvoice, ModelPaymentMethod, + ModelTag, ModelUnity, } from "./interfaces.js"; import { SevDeskUrls } from "./urls.js"; @@ -261,6 +262,21 @@ export class SevDeskClient { }); } + // ------------------------------------------------------- + // Tag + // ------------------------------------------------------- + + /** + * Get an overview of all tags + */ + async getTags(params: UrlParamsFor<"apiGetTagsUrl"> = {}) { + const url = this.urls.apiGetTagsUrl(params); + + return this.request<{ objects: Array> }>(url, { + method: "GET", + }); + } + // // pending invoices from sevdesk includes also outstanding / due invoices // // we remove them with a filter but you could also include the if you only need everything pending // async getPendingInvoices(options = { includeOutstanding: false }) { diff --git a/src/urls.ts b/src/urls.ts index 3ccd3df..91ffd4d 100644 --- a/src/urls.ts +++ b/src/urls.ts @@ -131,4 +131,15 @@ export class SevDeskUrls { query, }); } + + // ------------------------------------------------------- + // Tag + // ------------------------------------------------------- + + apiGetTagsUrl({ ...query }: DefaultCollectionQuery & Query = {}) { + return this.apiUrl({ + path: `Tag`, + query, + }); + } } From 033de13c4c6c59a8a88558400fb6ed6ca3443e95 Mon Sep 17 00:00:00 2001 From: Jonathan Derrough Date: Thu, 19 Dec 2024 11:09:19 +0100 Subject: [PATCH 05/10] feat: Adds getSevUsers --- src/client.test.ts | 19 ++++++++++++++----- src/client.ts | 16 ++++++++++++++++ src/urls.ts | 11 +++++++++++ 3 files changed, 41 insertions(+), 5 deletions(-) diff --git a/src/client.test.ts b/src/client.test.ts index 5f01e94..1320d73 100644 --- a/src/client.test.ts +++ b/src/client.test.ts @@ -11,6 +11,7 @@ import { ModelDocumentFolder, ModelInvoice, ModelPaymentMethod, + ModelSevUser, ModelTag, ModelUnity, } from "./interfaces.js"; @@ -49,10 +50,7 @@ test("Get next invoice number", async () => { }); test("Create a new invoice", async () => { - const { objects: invoiceNumber } = await sevDeskClient.getNextInvoiceNumber({ - invoiceType: "RE", - useNextNumber: true, - }); + const invoiceNumber = `TEST-${new Date().toISOString()}`; const { objects: contacts } = await sevDeskClient.getContacts(); const { @@ -147,7 +145,6 @@ test("Create a new invoice", async () => { discountDelete: null, }); - console.log(invoice); assertIsInvoice(invoice); }); @@ -211,6 +208,14 @@ test("Get tags", async () => { assert.is(tags.length > 0, true); tags.forEach(assertIsTag); }); + +test("Get users", async () => { + const { objects: users } = await sevDeskClient.getSevUsers(); + + assert.is(users.length > 0, true); + users.forEach(assertIsSevUser); +}); + const assertIsInvoice = (invoice: ModelInvoice) => { assert.is(invoice.objectName, "Invoice"); }; @@ -243,4 +248,8 @@ const assertIsTag = (tag: ModelTag) => { assert.is(tag.objectName, "Tag"); }; +const assertIsSevUser = (user: ModelSevUser) => { + assert.is(user.objectName, "SevUser"); +}; + test.run(); diff --git a/src/client.ts b/src/client.ts index 17b636f..fc469fe 100644 --- a/src/client.ts +++ b/src/client.ts @@ -8,6 +8,7 @@ import { ModelDocumentFolder, ModelInvoice, ModelPaymentMethod, + ModelSevUser, ModelTag, ModelUnity, } from "./interfaces.js"; @@ -277,6 +278,21 @@ export class SevDeskClient { }); } + // ------------------------------------------------------- + // SevUser + // ------------------------------------------------------- + + /** + * Get an overview of all users + */ + async getSevUsers(params: UrlParamsFor<"apiGetSevUsersUrl"> = {}) { + const url = this.urls.apiGetSevUsersUrl(params); + + return this.request<{ objects: Array> }>(url, { + method: "GET", + }); + } + // // pending invoices from sevdesk includes also outstanding / due invoices // // we remove them with a filter but you could also include the if you only need everything pending // async getPendingInvoices(options = { includeOutstanding: false }) { diff --git a/src/urls.ts b/src/urls.ts index 91ffd4d..6e5adb0 100644 --- a/src/urls.ts +++ b/src/urls.ts @@ -142,4 +142,15 @@ export class SevDeskUrls { query, }); } + + // ------------------------------------------------------- + // SevUser + // ------------------------------------------------------- + + apiGetSevUsersUrl({ ...query }: DefaultCollectionQuery & Query = {}) { + return this.apiUrl({ + path: `SevUser`, + query, + }); + } } From 57398e0d6ecc0e5b22dfa7116746b14c36b6cfbc Mon Sep 17 00:00:00 2001 From: Jonathan Derrough Date: Thu, 19 Dec 2024 11:09:59 +0100 Subject: [PATCH 06/10] fixes: Adds body.message as a source for error message --- src/client.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client.ts b/src/client.ts index fc469fe..a4ccfa0 100644 --- a/src/client.ts +++ b/src/client.ts @@ -66,7 +66,7 @@ export class SevDeskClient { throw error; } if (response.ok === false || error) { - const message = error?.message ?? body?.error?.message; + const message = error?.message ?? body?.error?.message ?? body.message; throw new UnknownApiError(message, { response }); } From a0f91b33deb0dcd9f25f5e93134581646904f927 Mon Sep 17 00:00:00 2001 From: Jonathan Derrough Date: Thu, 19 Dec 2024 14:58:21 +0100 Subject: [PATCH 07/10] feat: Adds getContactAdresses --- src/client.test.ts | 23 +++++++++++++++++++++++ src/client.ts | 21 +++++++++++++++++++++ src/urls.ts | 21 +++++++++++++++++++++ 3 files changed, 65 insertions(+) diff --git a/src/client.test.ts b/src/client.test.ts index 1320d73..fb3481a 100644 --- a/src/client.test.ts +++ b/src/client.test.ts @@ -7,6 +7,7 @@ import * as env from "./tests/env.js"; import { ModelCommunicationWay, ModelContact, + ModelContactAddress, ModelDocument, ModelDocumentFolder, ModelInvoice, @@ -180,6 +181,24 @@ test("Get contacts", async () => { contacts.forEach(assertIsContact); }); +test("Get contact addresses (without contact ID)", async () => { + const { objects: contactAddresses } = + await sevDeskClient.getContactAddresses(); + + assert.is(contactAddresses.length > 0, true); + contactAddresses.forEach(assertIsContactAddress); +}); + +test("Get contact addresses (with contact ID)", async () => { + const { objects: contacts } = await sevDeskClient.getContacts(); + const { objects: contactAddresses } = await sevDeskClient.getContactAddresses( + { contactId: contacts[0].id } + ); + + assert.is(contactAddresses.length > 0, true); + contactAddresses.forEach(assertIsContactAddress); +}); + test("Get communication ways", async () => { const { objects: communicationWays } = await sevDeskClient.getCommunicationWays(); @@ -232,6 +251,10 @@ const assertIsContact = (contact: ModelContact) => { assert.is(contact.objectName, "Contact"); }; +const assertIsContactAddress = (contact: ModelContactAddress) => { + assert.is(contact.objectName, "ContactAddress"); +}; + const assertIsCommunicationWay = (communicationWay: ModelCommunicationWay) => { assert.is(communicationWay.objectName, "CommunicationWay"); }; diff --git a/src/client.ts b/src/client.ts index a4ccfa0..0aa3413 100644 --- a/src/client.ts +++ b/src/client.ts @@ -4,6 +4,7 @@ import { UnknownApiError } from "./errors.js"; import { ModelCommunicationWay, ModelContact, + ModelContactAddress, ModelDocument, ModelDocumentFolder, ModelInvoice, @@ -207,6 +208,26 @@ export class SevDeskClient { }); } + // ------------------------------------------------------- + // ContactAddress + // ------------------------------------------------------- + + /** + * Get an overview of all contact addresses + */ + async getContactAddresses( + params: UrlParamsFor<"apiGetContactAddressesUrl"> = {} + ) { + const url = this.urls.apiGetContactAddressesUrl(params); + + return this.request<{ objects: Array> }>( + url, + { + method: "GET", + } + ); + } + // ------------------------------------------------------- // CommunicationWay // ------------------------------------------------------- diff --git a/src/urls.ts b/src/urls.ts index 6e5adb0..073a50b 100644 --- a/src/urls.ts +++ b/src/urls.ts @@ -97,6 +97,27 @@ export class SevDeskUrls { }); } + // ------------------------------------------------------- + // ContactAddress + // ------------------------------------------------------- + + apiGetContactAddressesUrl({ + contactId, + ...query + }: { contactId?: string | undefined } & DefaultCollectionQuery & Query = {}) { + if (contactId) { + return this.apiUrl({ + path: `Contact/${contactId}/getAddresses`, + query, + }); + } + + return this.apiUrl({ + path: `ContactAddress`, + query, + }); + } + // ------------------------------------------------------- // CommunicationWay // ------------------------------------------------------- From 202eeaa515d27d195438f7b8c5c62f030354b985 Mon Sep 17 00:00:00 2001 From: Jonathan Derrough Date: Thu, 19 Dec 2024 15:52:45 +0100 Subject: [PATCH 08/10] feat: Adds getStaticCountries --- src/client.test.ts | 12 ++++++++++++ src/client.ts | 18 ++++++++++++++++++ src/urls.ts | 11 +++++++++++ 3 files changed, 41 insertions(+) diff --git a/src/client.test.ts b/src/client.test.ts index fb3481a..8119b1b 100644 --- a/src/client.test.ts +++ b/src/client.test.ts @@ -13,6 +13,7 @@ import { ModelInvoice, ModelPaymentMethod, ModelSevUser, + ModelStaticCountry, ModelTag, ModelUnity, } from "./interfaces.js"; @@ -235,6 +236,13 @@ test("Get users", async () => { users.forEach(assertIsSevUser); }); +test("Get static countries", async () => { + const { objects: countries } = await sevDeskClient.getStaticCountries(); + + assert.is(countries.length > 0, true); + countries.forEach(assertIsStaticCountry); +}); + const assertIsInvoice = (invoice: ModelInvoice) => { assert.is(invoice.objectName, "Invoice"); }; @@ -275,4 +283,8 @@ const assertIsSevUser = (user: ModelSevUser) => { assert.is(user.objectName, "SevUser"); }; +const assertIsStaticCountry = (user: ModelStaticCountry) => { + assert.is(user.objectName, "StaticCountry"); +}; + test.run(); diff --git a/src/client.ts b/src/client.ts index 0aa3413..86fca52 100644 --- a/src/client.ts +++ b/src/client.ts @@ -10,6 +10,7 @@ import { ModelInvoice, ModelPaymentMethod, ModelSevUser, + ModelStaticCountry, ModelTag, ModelUnity, } from "./interfaces.js"; @@ -314,6 +315,23 @@ export class SevDeskClient { }); } + // ------------------------------------------------------- + // StaticCountry + // ------------------------------------------------------- + + /** + * Get an overview of all static countries + */ + async getStaticCountries( + params: UrlParamsFor<"apiGetStaticCountriesUrl"> = {} + ) { + const url = this.urls.apiGetStaticCountriesUrl(params); + + return this.request<{ objects: Array> }>(url, { + method: "GET", + }); + } + // // pending invoices from sevdesk includes also outstanding / due invoices // // we remove them with a filter but you could also include the if you only need everything pending // async getPendingInvoices(options = { includeOutstanding: false }) { diff --git a/src/urls.ts b/src/urls.ts index 073a50b..107cb2f 100644 --- a/src/urls.ts +++ b/src/urls.ts @@ -174,4 +174,15 @@ export class SevDeskUrls { query, }); } + + // ------------------------------------------------------- + // StaticCountry + // ------------------------------------------------------- + + apiGetStaticCountriesUrl({ ...query }: DefaultCollectionQuery & Query = {}) { + return this.apiUrl({ + path: `StaticCountry`, + query, + }); + } } From f0bbb2d5ded7ad9c5ad7f679778d655721d665bb Mon Sep 17 00:00:00 2001 From: Jonathan Derrough Date: Thu, 19 Dec 2024 18:35:18 +0100 Subject: [PATCH 09/10] feat: Adds getParts --- src/client.test.ts | 12 ++++++++++++ src/client.ts | 16 ++++++++++++++++ src/urls.ts | 11 +++++++++++ 3 files changed, 39 insertions(+) diff --git a/src/client.test.ts b/src/client.test.ts index 8119b1b..3c44b36 100644 --- a/src/client.test.ts +++ b/src/client.test.ts @@ -11,6 +11,7 @@ import { ModelDocument, ModelDocumentFolder, ModelInvoice, + ModelPart, ModelPaymentMethod, ModelSevUser, ModelStaticCountry, @@ -243,6 +244,13 @@ test("Get static countries", async () => { countries.forEach(assertIsStaticCountry); }); +test("Get parts", async () => { + const { objects: parts } = await sevDeskClient.getParts(); + + assert.is(parts.length > 0, true); + parts.forEach(assertIsPart); +}); + const assertIsInvoice = (invoice: ModelInvoice) => { assert.is(invoice.objectName, "Invoice"); }; @@ -287,4 +295,8 @@ const assertIsStaticCountry = (user: ModelStaticCountry) => { assert.is(user.objectName, "StaticCountry"); }; +const assertIsPart = (part: ModelPart) => { + assert.is(part.objectName, "Part"); +}; + test.run(); diff --git a/src/client.ts b/src/client.ts index 86fca52..8eef827 100644 --- a/src/client.ts +++ b/src/client.ts @@ -8,6 +8,7 @@ import { ModelDocument, ModelDocumentFolder, ModelInvoice, + ModelPart, ModelPaymentMethod, ModelSevUser, ModelStaticCountry, @@ -332,6 +333,21 @@ export class SevDeskClient { }); } + // ------------------------------------------------------- + // Part + // ------------------------------------------------------- + + /** + * Get an overview of all parts + */ + async getParts(params: UrlParamsFor<"apiGetPartsUrl"> = {}) { + const url = this.urls.apiGetPartsUrl(params); + + return this.request<{ objects: Array> }>(url, { + method: "GET", + }); + } + // // pending invoices from sevdesk includes also outstanding / due invoices // // we remove them with a filter but you could also include the if you only need everything pending // async getPendingInvoices(options = { includeOutstanding: false }) { diff --git a/src/urls.ts b/src/urls.ts index 107cb2f..bfb62c8 100644 --- a/src/urls.ts +++ b/src/urls.ts @@ -185,4 +185,15 @@ export class SevDeskUrls { query, }); } + + // ------------------------------------------------------- + // Part + // ------------------------------------------------------- + + apiGetPartsUrl({ ...query }: DefaultCollectionQuery & Query = {}) { + return this.apiUrl({ + path: `Part`, + query, + }); + } } From ad88088b8fb802b0bb003c754de8c97ae67e508d Mon Sep 17 00:00:00 2001 From: Jonathan Derrough Date: Fri, 20 Dec 2024 17:59:43 +0100 Subject: [PATCH 10/10] fix: Adds missing properties to saveInvoice response --- src/client.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/client.ts b/src/client.ts index 8eef827..f9e2cf8 100644 --- a/src/client.ts +++ b/src/client.ts @@ -8,6 +8,7 @@ import { ModelDocument, ModelDocumentFolder, ModelInvoice, + ModelInvoicePos, ModelPart, ModelPaymentMethod, ModelSevUser, @@ -125,7 +126,11 @@ export class SevDeskClient { const url = this.urls.apiSaveInvoiceUrl(); return this.request<{ - objects: { invoice: Required }; + objects: { + invoice: Required; + invoicePos: Array>; + filename: string; + }; }>(url, { method: "POST", body: JSON.stringify(body),