Skip to content

Commit

Permalink
feat: add method to get the bookkeeping system version
Browse files Browse the repository at this point in the history
  • Loading branch information
leMaik committed Jul 22, 2024
1 parent 1b7c39e commit 6dc48f7
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/SevdeskApiClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,20 @@ export default class XentralApiClient {
this.userAgent = options.userAgent;
}

//#region Basics
/**
* Get the bookkeeping system version. Sevdesk 2.0 introduces some breaking API changes so you'll
* have to use this and change the API payloads accordingly, depending on the version of the target instance.
* @see https://tech.sevdesk.com/api_news/posts/2024_04_04-system-update-breaking-changes/
* @returns The bookkeeping system version
*/
getBookkeepingSystemVersion(): Promise<{ version: '1.0' | '2.0' }> {
return this.apiRequest('/Tools/bookkeepingSystemVersion')
.then((res) => res.json())
.then(({ objects }) => objects);
}
//#endregion

/**
*
* @param route Route with leading slash (eg. /version)
Expand Down

0 comments on commit 6dc48f7

Please sign in to comment.