diff --git a/CHANGELOG.md b/CHANGELOG.md
index 53e16ccf..cd6a0583 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,653 +1,589 @@
## [10.3.1](https://github.com/peerigon/clockodo/compare/v10.3.0...v10.3.1) (2022-04-02)
-
### Bug Fixes
-* Replace deprecated faker functions ([33d3ed6](https://github.com/peerigon/clockodo/commit/33d3ed67d068e41bff439e0e8e96e0fc8000e8be))
+- Replace deprecated faker functions ([33d3ed6](https://github.com/peerigon/clockodo/commit/33d3ed67d068e41bff439e0e8e96e0fc8000e8be))
# [10.3.0](https://github.com/peerigon/clockodo/compare/v10.2.0...v10.3.0) (2022-04-02)
-
### Features
-* Update faker module ([787b4cd](https://github.com/peerigon/clockodo/commit/787b4cd778d255790bb6b0133756140e7b47ecb7))
+- Update faker module ([787b4cd](https://github.com/peerigon/clockodo/commit/787b4cd778d255790bb6b0133756140e7b47ecb7))
# [10.2.0](https://github.com/peerigon/clockodo/compare/v10.1.6...v10.2.0) (2022-03-30)
-
### Features
-* Make locale providable ([e12c8ab](https://github.com/peerigon/clockodo/commit/e12c8abdfab2f25be82103c00b892d1a62902ea1))
+- Make locale providable ([e12c8ab](https://github.com/peerigon/clockodo/commit/e12c8abdfab2f25be82103c00b892d1a62902ea1))
## [10.1.6](https://github.com/peerigon/clockodo/compare/v10.1.5...v10.1.6) (2022-03-11)
-
### Bug Fixes
-* Incorrect absence mock ([979266d](https://github.com/peerigon/clockodo/commit/979266d2c26902f3e6dc561f4676f3e0a93b0af5))
+- Incorrect absence mock ([979266d](https://github.com/peerigon/clockodo/commit/979266d2c26902f3e6dc561f4676f3e0a93b0af5))
## [10.1.5](https://github.com/peerigon/clockodo/compare/v10.1.4...v10.1.5) (2022-03-11)
-
### Bug Fixes
-* Incorrect entry mocks implementation ([3840ab6](https://github.com/peerigon/clockodo/commit/3840ab645ad856a51e6c94573c127dbc4bcf21cc))
+- Incorrect entry mocks implementation ([3840ab6](https://github.com/peerigon/clockodo/commit/3840ab645ad856a51e6c94573c127dbc4bcf21cc))
## [10.1.4](https://github.com/peerigon/clockodo/compare/v10.1.3...v10.1.4) (2022-03-11)
-
### Bug Fixes
-* Improve mocks ([1b951e8](https://github.com/peerigon/clockodo/commit/1b951e84c3bdb08cea43d2ee312c7be95946b99b))
+- Improve mocks ([1b951e8](https://github.com/peerigon/clockodo/commit/1b951e84c3bdb08cea43d2ee312c7be95946b99b))
## [10.1.3](https://github.com/peerigon/clockodo/compare/v10.1.2...v10.1.3) (2022-03-10)
-
### Bug Fixes
-* Export absence mocks ([b07b102](https://github.com/peerigon/clockodo/commit/b07b1028e33a15b8776f01aea857b1babd6416cf))
+- Export absence mocks ([b07b102](https://github.com/peerigon/clockodo/commit/b07b1028e33a15b8776f01aea857b1babd6416cf))
## [10.1.2](https://github.com/peerigon/clockodo/compare/v10.1.1...v10.1.2) (2022-03-10)
-
### Bug Fixes
-* Incorrect absence typings ([563c0c5](https://github.com/peerigon/clockodo/commit/563c0c5fd3428fd86ffd4feabc7ada0bb66821e8))
+- Incorrect absence typings ([563c0c5](https://github.com/peerigon/clockodo/commit/563c0c5fd3428fd86ffd4feabc7ada0bb66821e8))
## [10.1.1](https://github.com/peerigon/clockodo/compare/v10.1.0...v10.1.1) (2022-03-05)
-
### Bug Fixes
-* Incorrect userReport typings ([5440658](https://github.com/peerigon/clockodo/commit/5440658f10982c74be95d9107e4c6727e46cb814))
+- Incorrect userReport typings ([5440658](https://github.com/peerigon/clockodo/commit/5440658f10982c74be95d9107e4c6727e46cb814))
# [10.1.0](https://github.com/peerigon/clockodo/compare/v10.0.0...v10.1.0) (2022-01-02)
-
### Features
-* Add functions for parsing csv entries ([21c7176](https://github.com/peerigon/clockodo/commit/21c7176066679a0af5df38742b69869ab2008a50))
+- Add functions for parsing csv entries ([21c7176](https://github.com/peerigon/clockodo/commit/21c7176066679a0af5df38742b69869ab2008a50))
# [10.0.0](https://github.com/peerigon/clockodo/compare/v9.7.2...v10.0.0) (2021-12-15)
-
### Bug Fixes
-* Downgrade map-obj to CJS version ([8cd26ae](https://github.com/peerigon/clockodo/commit/8cd26aeb358f0bc7a8886c989598dcbe20b3e668))
-* Incorrect typing of "offset" ([a8f5752](https://github.com/peerigon/clockodo/commit/a8f5752e9c1f5495c3ef0d85d576e27bf0bdc980))
-* Issues with Turkish locale ([5831bbc](https://github.com/peerigon/clockodo/commit/5831bbc0174e03f20e1225911e08e892f6ef3f03))
-
+- Downgrade map-obj to CJS version ([8cd26ae](https://github.com/peerigon/clockodo/commit/8cd26aeb358f0bc7a8886c989598dcbe20b3e668))
+- Incorrect typing of "offset" ([a8f5752](https://github.com/peerigon/clockodo/commit/a8f5752e9c1f5495c3ef0d85d576e27bf0bdc980))
+- Issues with Turkish locale ([5831bbc](https://github.com/peerigon/clockodo/commit/5831bbc0174e03f20e1225911e08e892f6ef3f03))
### BREAKING CHANGES
-* The mapping algorithm to map camelCase to snake_case and vice versa has been changed. There is a slight chance that some keys might be mapped differently (although our tests did not reveal anything like that).
+- The mapping algorithm to map camelCase to snake_case and vice versa has been changed. There is a slight chance that some keys might be mapped differently (although our tests did not reveal anything like that).
# [10.0.0-beta.3](https://github.com/peerigon/clockodo/compare/v10.0.0-beta.2...v10.0.0-beta.3) (2021-12-09)
-
### Bug Fixes
-* Downgrade map-obj to CJS version ([8cd26ae](https://github.com/peerigon/clockodo/commit/8cd26aeb358f0bc7a8886c989598dcbe20b3e668))
+- Downgrade map-obj to CJS version ([8cd26ae](https://github.com/peerigon/clockodo/commit/8cd26aeb358f0bc7a8886c989598dcbe20b3e668))
# [10.0.0-beta.2](https://github.com/peerigon/clockodo/compare/v10.0.0-beta.1...v10.0.0-beta.2) (2021-12-08)
-
### Bug Fixes
-* Incorrect typing of "offset" ([a8f5752](https://github.com/peerigon/clockodo/commit/a8f5752e9c1f5495c3ef0d85d576e27bf0bdc980))
+- Incorrect typing of "offset" ([a8f5752](https://github.com/peerigon/clockodo/commit/a8f5752e9c1f5495c3ef0d85d576e27bf0bdc980))
# [10.0.0-beta.1](https://github.com/peerigon/clockodo/compare/v9.7.2...v10.0.0-beta.1) (2021-12-08)
-
### Bug Fixes
-* Issues with Turkish locale ([5831bbc](https://github.com/peerigon/clockodo/commit/5831bbc0174e03f20e1225911e08e892f6ef3f03))
-
+- Issues with Turkish locale ([5831bbc](https://github.com/peerigon/clockodo/commit/5831bbc0174e03f20e1225911e08e892f6ef3f03))
### BREAKING CHANGES
-* The mapping algorithm to map camelCase to snake_case and vice versa has been changed. There is a slight chance that some keys might be mapped differently (although our tests did not reveal anything like that).
+- The mapping algorithm to map camelCase to snake_case and vice versa has been changed. There is a slight chance that some keys might be mapped differently (although our tests did not reveal anything like that).
## [9.7.2](https://github.com/peerigon/clockodo/compare/v9.7.1...v9.7.2) (2021-11-30)
-
### Bug Fixes
-* Incorrect typing of countReductionUsed ([6671c9f](https://github.com/peerigon/clockodo/commit/6671c9f417be0815d55c05bd3cababae5dddfdc0))
+- Incorrect typing of countReductionUsed ([6671c9f](https://github.com/peerigon/clockodo/commit/6671c9f417be0815d55c05bd3cababae5dddfdc0))
## [9.7.1](https://github.com/peerigon/clockodo/compare/v9.7.0...v9.7.1) (2021-11-28)
-
### Bug Fixes
-* Improve UserReport typings ([f3c7c56](https://github.com/peerigon/clockodo/commit/f3c7c56103d9202d4d5fa1e3c30e2a4ed51b699d))
+- Improve UserReport typings ([f3c7c56](https://github.com/peerigon/clockodo/commit/f3c7c56103d9202d4d5fa1e3c30e2a4ed51b699d))
# [9.7.0](https://github.com/peerigon/clockodo/compare/v9.6.1...v9.7.0) (2021-11-13)
-
### Features
-* Add getNonbusinessGroups() and getNonbusinessDays() ([ba034ef](https://github.com/peerigon/clockodo/commit/ba034ef00362e1afeecd175a8153e694a66e16ce))
+- Add getNonbusinessGroups() and getNonbusinessDays() ([ba034ef](https://github.com/peerigon/clockodo/commit/ba034ef00362e1afeecd175a8153e694a66e16ce))
## [9.6.1](https://github.com/peerigon/clockodo/compare/v9.6.0...v9.6.1) (2021-11-12)
-
### Bug Fixes
-* Incorrect TypeScript typings of addAbsence() ([ded0d1d](https://github.com/peerigon/clockodo/commit/ded0d1d1f3ae66614df79de48b6dae1d7e922a39))
+- Incorrect TypeScript typings of addAbsence() ([ded0d1d](https://github.com/peerigon/clockodo/commit/ded0d1d1f3ae66614df79de48b6dae1d7e922a39))
# [9.6.0](https://github.com/peerigon/clockodo/compare/v9.5.2...v9.6.0) (2021-11-01)
-
### Features
-* Add getAggregatesUsersMe() ([c6385e1](https://github.com/peerigon/clockodo/commit/c6385e180a250b6b88fc1120a840b7296915834f))
-* Improve targethours typings ([3b063ab](https://github.com/peerigon/clockodo/commit/3b063ab520ffae4be3c050eba87e376bb13b29ef))
+- Add getAggregatesUsersMe() ([c6385e1](https://github.com/peerigon/clockodo/commit/c6385e180a250b6b88fc1120a840b7296915834f))
+- Improve targethours typings ([3b063ab](https://github.com/peerigon/clockodo/commit/3b063ab520ffae4be3c050eba87e376bb13b29ef))
## [9.5.2](https://github.com/peerigon/clockodo/compare/v9.5.1...v9.5.2) (2021-10-24)
-
### Bug Fixes
-* **TypeScript:** Incorrect absence types ([e0f2136](https://github.com/peerigon/clockodo/commit/e0f21365872e5efaabad3264281c8ed2fc899711))
+- **TypeScript:** Incorrect absence types ([e0f2136](https://github.com/peerigon/clockodo/commit/e0f21365872e5efaabad3264281c8ed2fc899711))
## [9.5.1](https://github.com/peerigon/clockodo/compare/v9.5.0...v9.5.1) (2021-10-11)
-
### Bug Fixes
-* Incorrect Entry and LumpsumService mocks ([12cc74a](https://github.com/peerigon/clockodo/commit/12cc74a778f8242c5e086a9c9c3eebfbf8ac1df9))
+- Incorrect Entry and LumpsumService mocks ([12cc74a](https://github.com/peerigon/clockodo/commit/12cc74a778f8242c5e086a9c9c3eebfbf8ac1df9))
# [9.5.0](https://github.com/peerigon/clockodo/compare/v9.4.0...v9.5.0) (2021-10-09)
-
### Features
-* Improve entry filters ([613fa00](https://github.com/peerigon/clockodo/commit/613fa006b0e5d27c2a30718bb9788a46b780ec7b))
+- Improve entry filters ([613fa00](https://github.com/peerigon/clockodo/commit/613fa006b0e5d27c2a30718bb9788a46b780ec7b))
# [9.4.0](https://github.com/peerigon/clockodo/compare/v9.3.0...v9.4.0) (2021-10-09)
-
### Bug Fixes
-* Unrecognized package exports in TypeScript ([1d41301](https://github.com/peerigon/clockodo/commit/1d41301071bc125d5db72119b15b6792d55fd089))
-
+- Unrecognized package exports in TypeScript ([1d41301](https://github.com/peerigon/clockodo/commit/1d41301071bc125d5db72119b15b6792d55fd089))
### Features
-* Expose a way to set the faker seed ([726f8e5](https://github.com/peerigon/clockodo/commit/726f8e5c5b13cad8403f8d09b3e3cf31019e2021))
+- Expose a way to set the faker seed ([726f8e5](https://github.com/peerigon/clockodo/commit/726f8e5c5b13cad8403f8d09b3e3cf31019e2021))
# [9.3.0](https://github.com/peerigon/clockodo/compare/v9.2.0...v9.3.0) (2021-10-09)
-
### Features
-* Add entry utility functions ([047deb7](https://github.com/peerigon/clockodo/commit/047deb7c3da02a8aa0177cb3b77697030dfa60b8))
-* Add entry utils ([d566218](https://github.com/peerigon/clockodo/commit/d566218ee243c6efa0886a9240c78907d4a1019d))
-* Introduce subpackage mocks ([f8a8d5f](https://github.com/peerigon/clockodo/commit/f8a8d5f2ae3fd358845cd10bfdfa910b29e9d325))
+- Add entry utility functions ([047deb7](https://github.com/peerigon/clockodo/commit/047deb7c3da02a8aa0177cb3b77697030dfa60b8))
+- Add entry utils ([d566218](https://github.com/peerigon/clockodo/commit/d566218ee243c6efa0886a9240c78907d4a1019d))
+- Introduce subpackage mocks ([f8a8d5f](https://github.com/peerigon/clockodo/commit/f8a8d5f2ae3fd358845cd10bfdfa910b29e9d325))
# [9.2.0](https://github.com/peerigon/clockodo/compare/v9.1.1...v9.2.0) (2021-10-08)
-
### Features
-* Add customer color property ([#73](https://github.com/peerigon/clockodo/issues/73)) ([0150677](https://github.com/peerigon/clockodo/commit/0150677653c45948172bf729241ca635e1631d3a))
+- Add customer color property ([#73](https://github.com/peerigon/clockodo/issues/73)) ([0150677](https://github.com/peerigon/clockodo/commit/0150677653c45948172bf729241ca635e1631d3a))
## [9.1.1](https://github.com/peerigon/clockodo/compare/v9.1.0...v9.1.1) (2021-09-17)
-
### Bug Fixes
-* Update user types ([c9c8652](https://github.com/peerigon/clockodo/commit/c9c865265901fa10e772296c8d26a858682ef737))
+- Update user types ([c9c8652](https://github.com/peerigon/clockodo/commit/c9c865265901fa10e772296c8d26a858682ef737))
# [9.1.0](https://github.com/peerigon/clockodo/compare/v9.0.0...v9.1.0) (2021-09-14)
-
### Features
-* Add getProjects() ([a44785f](https://github.com/peerigon/clockodo/commit/a44785f833974ad82d038d7a9a6148a910790e59))
+- Add getProjects() ([a44785f](https://github.com/peerigon/clockodo/commit/a44785f833974ad82d038d7a9a6148a910790e59))
# [9.0.0](https://github.com/peerigon/clockodo/compare/v8.0.7...v9.0.0) (2021-09-13)
-
### Bug Fixes
-* Correct more types ([323bed5](https://github.com/peerigon/clockodo/commit/323bed55e50f6bf62cb793cdf47d904c87f8f2de))
-* Correct type attribution ([f895fa9](https://github.com/peerigon/clockodo/commit/f895fa925c63a1dbec6800452e2074930dc69b46))
-* Improve types ([9266392](https://github.com/peerigon/clockodo/commit/9266392df6660268837cd656e134f58b2cdf0340))
-* Improve types and wording ([3f79891](https://github.com/peerigon/clockodo/commit/3f798911a6d93fb3929638ec09dc237b58b184ff))
-* Make header required and use it in integration tests ([a028311](https://github.com/peerigon/clockodo/commit/a02831172a4a9438726c114daa715bab559a74d7))
-* Repair Tests ([865aede](https://github.com/peerigon/clockodo/commit/865aede39eb96cb2001d9caa1938b0660fd161f0))
-* Repair Unit Tests ([8da6020](https://github.com/peerigon/clockodo/commit/8da60206924a24c6827a59f2f0c50a0055cd8c6e))
-* Revert incorrect typing of timeClockedSince ([cc4d797](https://github.com/peerigon/clockodo/commit/cc4d79739a028d5765efae0957fc75dafa7bd895))
-* TimeEntry typing of timeClockedSince property ([770f47a](https://github.com/peerigon/clockodo/commit/770f47ad292ae29371e3fa567523cda3354b1b94))
-
+- Correct more types ([323bed5](https://github.com/peerigon/clockodo/commit/323bed55e50f6bf62cb793cdf47d904c87f8f2de))
+- Correct type attribution ([f895fa9](https://github.com/peerigon/clockodo/commit/f895fa925c63a1dbec6800452e2074930dc69b46))
+- Improve types ([9266392](https://github.com/peerigon/clockodo/commit/9266392df6660268837cd656e134f58b2cdf0340))
+- Improve types and wording ([3f79891](https://github.com/peerigon/clockodo/commit/3f798911a6d93fb3929638ec09dc237b58b184ff))
+- Make header required and use it in integration tests ([a028311](https://github.com/peerigon/clockodo/commit/a02831172a4a9438726c114daa715bab559a74d7))
+- Repair Tests ([865aede](https://github.com/peerigon/clockodo/commit/865aede39eb96cb2001d9caa1938b0660fd161f0))
+- Repair Unit Tests ([8da6020](https://github.com/peerigon/clockodo/commit/8da60206924a24c6827a59f2f0c50a0055cd8c6e))
+- Revert incorrect typing of timeClockedSince ([cc4d797](https://github.com/peerigon/clockodo/commit/cc4d79739a028d5765efae0957fc75dafa7bd895))
+- TimeEntry typing of timeClockedSince property ([770f47a](https://github.com/peerigon/clockodo/commit/770f47ad292ae29371e3fa567523cda3354b1b94))
### chore
-* Remove internals folder ([994550a](https://github.com/peerigon/clockodo/commit/994550a096056c07c0e86f3ac9f392e78205c301))
-
+- Remove internals folder ([994550a](https://github.com/peerigon/clockodo/commit/994550a096056c07c0e86f3ac9f392e78205c301))
### Features
-* Add API v2 changes ([0f8bc56](https://github.com/peerigon/clockodo/commit/0f8bc5637911b9ceea4c53a973c7bd7fff5068d0))
-* Add proper native ESM support ([2846a94](https://github.com/peerigon/clockodo/commit/2846a9409e8e1974a4a1a7807eecdb9dadaf12f8))
-* Do not use class properties as methods anymore ([a0d04c3](https://github.com/peerigon/clockodo/commit/a0d04c34efd131c6fe4d4ca3e5bfd2a6c8934501))
-* Introduce enums ([0515034](https://github.com/peerigon/clockodo/commit/0515034de054d1aeceb888ba3c59bef4812ae373))
-* Publish beta version ([1446e55](https://github.com/peerigon/clockodo/commit/1446e557c0e934dbefac2b666ee29f7c5cd8933b))
-* Publish beta version ([000369a](https://github.com/peerigon/clockodo/commit/000369a40bb3995c1926dfab53a2f3a12e526a3d))
-* Publish beta version ([2018711](https://github.com/peerigon/clockodo/commit/201871129cc94772b4920c59bad55912e9675391))
-* remove offset property ([bbf047b](https://github.com/peerigon/clockodo/commit/bbf047b08c6a3da7647128f747fe7e85d66c5cbf))
-* Remove Promise<> type from returnTypes ([d6f4c15](https://github.com/peerigon/clockodo/commit/d6f4c15d8aff7f0187f99086fb338cc2fa8c1463))
-* Switch to MIT license ([dd07fb1](https://github.com/peerigon/clockodo/commit/dd07fb172e63ab093b5bdcf8ba61658e49095b59))
-* Use new endpoints in code, remove old ones ([d3495f4](https://github.com/peerigon/clockodo/commit/d3495f4053c864c2736adaad6e01407b55c30177))
-
+- Add API v2 changes ([0f8bc56](https://github.com/peerigon/clockodo/commit/0f8bc5637911b9ceea4c53a973c7bd7fff5068d0))
+- Add proper native ESM support ([2846a94](https://github.com/peerigon/clockodo/commit/2846a9409e8e1974a4a1a7807eecdb9dadaf12f8))
+- Do not use class properties as methods anymore ([a0d04c3](https://github.com/peerigon/clockodo/commit/a0d04c34efd131c6fe4d4ca3e5bfd2a6c8934501))
+- Introduce enums ([0515034](https://github.com/peerigon/clockodo/commit/0515034de054d1aeceb888ba3c59bef4812ae373))
+- Publish beta version ([1446e55](https://github.com/peerigon/clockodo/commit/1446e557c0e934dbefac2b666ee29f7c5cd8933b))
+- Publish beta version ([000369a](https://github.com/peerigon/clockodo/commit/000369a40bb3995c1926dfab53a2f3a12e526a3d))
+- Publish beta version ([2018711](https://github.com/peerigon/clockodo/commit/201871129cc94772b4920c59bad55912e9675391))
+- remove offset property ([bbf047b](https://github.com/peerigon/clockodo/commit/bbf047b08c6a3da7647128f747fe7e85d66c5cbf))
+- Remove Promise<> type from returnTypes ([d6f4c15](https://github.com/peerigon/clockodo/commit/d6f4c15d8aff7f0187f99086fb338cc2fa8c1463))
+- Switch to MIT license ([dd07fb1](https://github.com/peerigon/clockodo/commit/dd07fb172e63ab093b5bdcf8ba61658e49095b59))
+- Use new endpoints in code, remove old ones ([d3495f4](https://github.com/peerigon/clockodo/commit/d3495f4053c864c2736adaad6e01407b55c30177))
### BREAKING CHANGES
-* Methods on Clockodo and Api instances won't be bound to the instance anymore.
-* The return types are not wrapped in Promise<> types anymore. You may need to update your types.
-* Switch to MIT license
-* All files inside internals have been moved up to the src directory. This change might break your app in case you've used deep package imports.
-* Depending on your build and runtime configuration, this change might break your path resolution.
+- Methods on Clockodo and Api instances won't be bound to the instance anymore.
+- The return types are not wrapped in Promise<> types anymore. You may need to update your types.
+- Switch to MIT license
+- All files inside internals have been moved up to the src directory. This change might break your app in case you've used deep package imports.
+- Depending on your build and runtime configuration, this change might break your path resolution.
# [9.0.0-beta.2](https://github.com/peerigon/clockodo/compare/v9.0.0-beta.1...v9.0.0-beta.2) (2021-09-13)
-
### chore
-* Remove internals folder ([994550a](https://github.com/peerigon/clockodo/commit/994550a096056c07c0e86f3ac9f392e78205c301))
-
+- Remove internals folder ([994550a](https://github.com/peerigon/clockodo/commit/994550a096056c07c0e86f3ac9f392e78205c301))
### Features
-* Do not use class properties as methods anymore ([a0d04c3](https://github.com/peerigon/clockodo/commit/a0d04c34efd131c6fe4d4ca3e5bfd2a6c8934501))
-* Remove Promise<> type from returnTypes ([d6f4c15](https://github.com/peerigon/clockodo/commit/d6f4c15d8aff7f0187f99086fb338cc2fa8c1463))
-* Switch to MIT license ([dd07fb1](https://github.com/peerigon/clockodo/commit/dd07fb172e63ab093b5bdcf8ba61658e49095b59))
-
+- Do not use class properties as methods anymore ([a0d04c3](https://github.com/peerigon/clockodo/commit/a0d04c34efd131c6fe4d4ca3e5bfd2a6c8934501))
+- Remove Promise<> type from returnTypes ([d6f4c15](https://github.com/peerigon/clockodo/commit/d6f4c15d8aff7f0187f99086fb338cc2fa8c1463))
+- Switch to MIT license ([dd07fb1](https://github.com/peerigon/clockodo/commit/dd07fb172e63ab093b5bdcf8ba61658e49095b59))
### BREAKING CHANGES
-* Methods on Clockodo and Api instances won't be bound to the instance anymore.
-* The return types are not wrapped in Promise<> types anymore. You may need to update your types.
-* Switch to MIT license
-* All files inside internals have been moved up to the src directory. This change might break your app in case you've used deep package imports.
+- Methods on Clockodo and Api instances won't be bound to the instance anymore.
+- The return types are not wrapped in Promise<> types anymore. You may need to update your types.
+- Switch to MIT license
+- All files inside internals have been moved up to the src directory. This change might break your app in case you've used deep package imports.
# [9.0.0-beta.1](https://github.com/peerigon/clockodo/compare/v8.1.0-beta.14...v9.0.0-beta.1) (2021-09-13)
-
### Features
-* Add proper native ESM support ([2846a94](https://github.com/peerigon/clockodo/commit/2846a9409e8e1974a4a1a7807eecdb9dadaf12f8))
-
+- Add proper native ESM support ([2846a94](https://github.com/peerigon/clockodo/commit/2846a9409e8e1974a4a1a7807eecdb9dadaf12f8))
### BREAKING CHANGES
-* Depending on your build and runtime configuration, this change might break your path resolution.
+- Depending on your build and runtime configuration, this change might break your path resolution.
# [8.1.0-beta.14](https://github.com/peerigon/clockodo/compare/v8.1.0-beta.13...v8.1.0-beta.14) (2021-06-02)
-
### Bug Fixes
-* Revert incorrect typing of timeClockedSince ([cc4d797](https://github.com/peerigon/clockodo/commit/cc4d79739a028d5765efae0957fc75dafa7bd895))
+- Revert incorrect typing of timeClockedSince ([cc4d797](https://github.com/peerigon/clockodo/commit/cc4d79739a028d5765efae0957fc75dafa7bd895))
# [8.1.0-beta.13](https://github.com/peerigon/clockodo/compare/v8.1.0-beta.12...v8.1.0-beta.13) (2021-06-02)
-
### Bug Fixes
-* TimeEntry typing of timeClockedSince property ([770f47a](https://github.com/peerigon/clockodo/commit/770f47ad292ae29371e3fa567523cda3354b1b94))
+- TimeEntry typing of timeClockedSince property ([770f47a](https://github.com/peerigon/clockodo/commit/770f47ad292ae29371e3fa567523cda3354b1b94))
# [8.1.0-beta.12](https://github.com/peerigon/clockodo/compare/v8.1.0-beta.11...v8.1.0-beta.12) (2021-05-31)
-
### Features
-* Add API v2 changes ([0f8bc56](https://github.com/peerigon/clockodo/commit/0f8bc5637911b9ceea4c53a973c7bd7fff5068d0))
+- Add API v2 changes ([0f8bc56](https://github.com/peerigon/clockodo/commit/0f8bc5637911b9ceea4c53a973c7bd7fff5068d0))
# [8.1.0-beta.11](https://github.com/peerigon/clockodo/compare/v8.1.0-beta.10...v8.1.0-beta.11) (2021-05-31)
-
### Features
-* remove offset property ([bbf047b](https://github.com/peerigon/clockodo/commit/bbf047b08c6a3da7647128f747fe7e85d66c5cbf))
+- remove offset property ([bbf047b](https://github.com/peerigon/clockodo/commit/bbf047b08c6a3da7647128f747fe7e85d66c5cbf))
# [8.1.0-beta.10](https://github.com/peerigon/clockodo/compare/v8.1.0-beta.9...v8.1.0-beta.10) (2021-05-31)
-
### Features
-* Publish beta version ([1446e55](https://github.com/peerigon/clockodo/commit/1446e557c0e934dbefac2b666ee29f7c5cd8933b))
+- Publish beta version ([1446e55](https://github.com/peerigon/clockodo/commit/1446e557c0e934dbefac2b666ee29f7c5cd8933b))
# [8.1.0-beta.9](https://github.com/peerigon/clockodo/compare/v8.1.0-beta.8...v8.1.0-beta.9) (2021-05-25)
-
### Features
-* Publish beta version ([000369a](https://github.com/peerigon/clockodo/commit/000369a40bb3995c1926dfab53a2f3a12e526a3d))
+- Publish beta version ([000369a](https://github.com/peerigon/clockodo/commit/000369a40bb3995c1926dfab53a2f3a12e526a3d))
# [8.1.0-beta.8](https://github.com/peerigon/clockodo/compare/v8.1.0-beta.7...v8.1.0-beta.8) (2021-05-25)
-
### Features
-* Publish beta version ([2018711](https://github.com/peerigon/clockodo/commit/201871129cc94772b4920c59bad55912e9675391))
+- Publish beta version ([2018711](https://github.com/peerigon/clockodo/commit/201871129cc94772b4920c59bad55912e9675391))
# [8.1.0-beta.7](https://github.com/peerigon/clockodo/compare/v8.1.0-beta.6...v8.1.0-beta.7) (2021-05-19)
-
### Features
-* Introduce enums ([0515034](https://github.com/peerigon/clockodo/commit/0515034de054d1aeceb888ba3c59bef4812ae373))
+- Introduce enums ([0515034](https://github.com/peerigon/clockodo/commit/0515034de054d1aeceb888ba3c59bef4812ae373))
# [8.1.0-beta.6](https://github.com/peerigon/clockodo/compare/v8.1.0-beta.5...v8.1.0-beta.6) (2021-05-07)
-
### Bug Fixes
-* Make header required and use it in integration tests ([a028311](https://github.com/peerigon/clockodo/commit/a02831172a4a9438726c114daa715bab559a74d7))
-* Repair Tests ([865aede](https://github.com/peerigon/clockodo/commit/865aede39eb96cb2001d9caa1938b0660fd161f0))
+- Make header required and use it in integration tests ([a028311](https://github.com/peerigon/clockodo/commit/a02831172a4a9438726c114daa715bab559a74d7))
+- Repair Tests ([865aede](https://github.com/peerigon/clockodo/commit/865aede39eb96cb2001d9caa1938b0660fd161f0))
# [8.1.0-beta.5](https://github.com/peerigon/clockodo/compare/v8.1.0-beta.4...v8.1.0-beta.5) (2021-05-05)
-
### Bug Fixes
-* Correct more types ([323bed5](https://github.com/peerigon/clockodo/commit/323bed55e50f6bf62cb793cdf47d904c87f8f2de))
+- Correct more types ([323bed5](https://github.com/peerigon/clockodo/commit/323bed55e50f6bf62cb793cdf47d904c87f8f2de))
# [8.1.0-beta.4](https://github.com/peerigon/clockodo/compare/v8.1.0-beta.3...v8.1.0-beta.4) (2021-04-30)
-
### Bug Fixes
-* Correct type attribution ([f895fa9](https://github.com/peerigon/clockodo/commit/f895fa925c63a1dbec6800452e2074930dc69b46))
+- Correct type attribution ([f895fa9](https://github.com/peerigon/clockodo/commit/f895fa925c63a1dbec6800452e2074930dc69b46))
# [8.1.0-beta.3](https://github.com/peerigon/clockodo/compare/v8.1.0-beta.2...v8.1.0-beta.3) (2021-04-29)
-
### Bug Fixes
-* Improve types ([9266392](https://github.com/peerigon/clockodo/commit/9266392df6660268837cd656e134f58b2cdf0340))
+- Improve types ([9266392](https://github.com/peerigon/clockodo/commit/9266392df6660268837cd656e134f58b2cdf0340))
# [8.1.0-beta.2](https://github.com/peerigon/clockodo/compare/v8.1.0-beta.1...v8.1.0-beta.2) (2021-04-27)
-
### Bug Fixes
-* Improve types and wording ([3f79891](https://github.com/peerigon/clockodo/commit/3f798911a6d93fb3929638ec09dc237b58b184ff))
+- Improve types and wording ([3f79891](https://github.com/peerigon/clockodo/commit/3f798911a6d93fb3929638ec09dc237b58b184ff))
# [8.1.0-beta.1](https://github.com/peerigon/clockodo/compare/v8.0.7...v8.1.0-beta.1) (2021-04-27)
-
### Bug Fixes
-* Repair Unit Tests ([8da6020](https://github.com/peerigon/clockodo/commit/8da60206924a24c6827a59f2f0c50a0055cd8c6e))
-
+- Repair Unit Tests ([8da6020](https://github.com/peerigon/clockodo/commit/8da60206924a24c6827a59f2f0c50a0055cd8c6e))
### Features
-* Use new endpoints in code, remove old ones ([d3495f4](https://github.com/peerigon/clockodo/commit/d3495f4053c864c2736adaad6e01407b55c30177))
+- Use new endpoints in code, remove old ones ([d3495f4](https://github.com/peerigon/clockodo/commit/d3495f4053c864c2736adaad6e01407b55c30177))
## [8.0.7](https://github.com/peerigon/clockodo/compare/v8.0.6...v8.0.7) (2021-04-16)
-
### Bug Fixes
-* **typescript:** Make restricted project properties optional ([936f134](https://github.com/peerigon/clockodo/commit/936f1340391fc6135c879b55c425d4a200983322))
-* **typescript:** revenueFactor can be null ([d0f8965](https://github.com/peerigon/clockodo/commit/d0f896507550bdd81e8c9db90adf53d315c7f360))
+- **typescript:** Make restricted project properties optional ([936f134](https://github.com/peerigon/clockodo/commit/936f1340391fc6135c879b55c425d4a200983322))
+- **typescript:** revenueFactor can be null ([d0f8965](https://github.com/peerigon/clockodo/commit/d0f896507550bdd81e8c9db90adf53d315c7f360))
## [8.0.6](https://github.com/peerigon/clockodo/compare/v8.0.5...v8.0.6) (2021-03-01)
-
### Bug Fixes
-* Wrong URL being used in getSearchTexts() ([#64](https://github.com/peerigon/clockodo/issues/64)) ([32931b7](https://github.com/peerigon/clockodo/commit/32931b7275859dbbbc667e6c3c26612d27bb6a6c))
+- Wrong URL being used in getSearchTexts() ([#64](https://github.com/peerigon/clockodo/issues/64)) ([32931b7](https://github.com/peerigon/clockodo/commit/32931b7275859dbbbc667e6c3c26612d27bb6a6c))
## [8.0.5](https://github.com/peerigon/clockodo/compare/v8.0.4...v8.0.5) (2021-02-12)
-
### Bug Fixes
-* Wrong package configuration ([f696320](https://github.com/peerigon/clockodo/commit/f6963206fdf7cc620e9b62c7eca7fe9c54fa8fa2))
+- Wrong package configuration ([f696320](https://github.com/peerigon/clockodo/commit/f6963206fdf7cc620e9b62c7eca7fe9c54fa8fa2))
## [8.0.4](https://github.com/peerigon/clockodo/compare/v8.0.3...v8.0.4) (2021-02-12)
-
### Bug Fixes
-* exports-fields in package.json ([cbb45ab](https://github.com/peerigon/clockodo/commit/cbb45ab895cfc52afd1f0fe6b2c3f89855e9fa49))
+- exports-fields in package.json ([cbb45ab](https://github.com/peerigon/clockodo/commit/cbb45ab895cfc52afd1f0fe6b2c3f89855e9fa49))
## [8.0.3](https://github.com/peerigon/clockodo/compare/v8.0.2...v8.0.3) (2021-02-11)
-
### Bug Fixes
-* Enable CORS for login requests ([8e6859e](https://github.com/peerigon/clockodo/commit/8e6859e4d39f90cfc7dfd49f41f37fd0a5cd744c))
+- Enable CORS for login requests ([8e6859e](https://github.com/peerigon/clockodo/commit/8e6859e4d39f90cfc7dfd49f41f37fd0a5cd744c))
## [8.0.2](https://github.com/peerigon/clockodo/compare/v8.0.1...v8.0.2) (2021-02-10)
-
### Bug Fixes
-* Update dependencies ([da2dfbe](https://github.com/peerigon/clockodo/commit/da2dfbe39d3ec4d271f1be899b40c11bae41b5eb))
+- Update dependencies ([da2dfbe](https://github.com/peerigon/clockodo/commit/da2dfbe39d3ec4d271f1be899b40c11bae41b5eb))
## [8.0.1](https://github.com/peerigon/clockodo/compare/v8.0.0...v8.0.1) (2021-02-10)
-
### Bug Fixes
-* Broken plugin import statements ([b0fa5ac](https://github.com/peerigon/clockodo/commit/b0fa5ac3fef8e12825add5a7a2870f2bbed25d40))
+- Broken plugin import statements ([b0fa5ac](https://github.com/peerigon/clockodo/commit/b0fa5ac3fef8e12825add5a7a2870f2bbed25d40))
# [8.0.0](https://github.com/peerigon/clockodo/compare/v7.0.0...v8.0.0) (2021-02-10)
-
### Bug Fixes
-* Improve types ([102655a](https://github.com/peerigon/clockodo/commit/102655a85690a8b5ce93e1bd5714bb30bc9e1fe5))
-* typo ([817d3e5](https://github.com/peerigon/clockodo/commit/817d3e527d55f55f8d0fcc5b2f011420cd2d5bd4))
-
+- Improve types ([102655a](https://github.com/peerigon/clockodo/commit/102655a85690a8b5ce93e1bd5714bb30bc9e1fe5))
+- typo ([817d3e5](https://github.com/peerigon/clockodo/commit/817d3e527d55f55f8d0fcc5b2f011420cd2d5bd4))
### Features
-* Add cookie authentication support ([9fc6276](https://github.com/peerigon/clockodo/commit/9fc6276c021605b64dad35525cbbde8ec47365a6))
-* Add ESM support ([c09e86c](https://github.com/peerigon/clockodo/commit/c09e86c6f4f017b5d54db9c6ca7386d24fc6f8e1))
-* Add getLumpSumServices() ([cc344e0](https://github.com/peerigon/clockodo/commit/cc344e05969bcc7f40c103ff17e83690df96e5d2))
-* Enable ISO UTC date times for all requests ([6905d6b](https://github.com/peerigon/clockodo/commit/6905d6b251fe27dfd5ef92ad8f46401f96c2b337))
-* Refactor public interface ([2c23de4](https://github.com/peerigon/clockodo/commit/2c23de48d8f0532061d785ce64444afff5dd94f0)), closes [#50](https://github.com/peerigon/clockodo/issues/50) [#50](https://github.com/peerigon/clockodo/issues/50)
-
+- Add cookie authentication support ([9fc6276](https://github.com/peerigon/clockodo/commit/9fc6276c021605b64dad35525cbbde8ec47365a6))
+- Add ESM support ([c09e86c](https://github.com/peerigon/clockodo/commit/c09e86c6f4f017b5d54db9c6ca7386d24fc6f8e1))
+- Add getLumpSumServices() ([cc344e0](https://github.com/peerigon/clockodo/commit/cc344e05969bcc7f40c103ff17e83690df96e5d2))
+- Enable ISO UTC date times for all requests ([6905d6b](https://github.com/peerigon/clockodo/commit/6905d6b251fe27dfd5ef92ad8f46401f96c2b337))
+- Refactor public interface ([2c23de4](https://github.com/peerigon/clockodo/commit/2c23de48d8f0532061d785ce64444afff5dd94f0)), closes [#50](https://github.com/peerigon/clockodo/issues/50) [#50](https://github.com/peerigon/clockodo/issues/50)
### BREAKING CHANGES
-* clockodo is now available as CommonJS and ECMAScript module. Although very unlikely, this might cause issues depending on your specific setup.
-* All timestamps are now returned as ISO UTC. You don't need the user's time zone to interpret the times correctly now.
-* Some return types have been updated and corrected. This might result in TypeScript errors.
-* The Clockodo constructor arguments have changed a little bit. Check out the documentation for correct usage.
+- clockodo is now available as CommonJS and ECMAScript module. Although very unlikely, this might cause issues depending on your specific setup.
+- All timestamps are now returned as ISO UTC. You don't need the user's time zone to interpret the times correctly now.
+- Some return types have been updated and corrected. This might result in TypeScript errors.
+- The Clockodo constructor arguments have changed a little bit. Check out the documentation for correct usage.
# [7.0.0](https://github.com/peerigon/clockodo/compare/v6.0.2...v7.0.0) (2020-12-03)
### Bug Fixes
-- billable not required when calling addEntry() with a lumpsum entry ([f422119](https://github.com/peerigon/clockodo/commit/f422119df88cc976c41103dea11400b4549211fb))
-- Incorrect addEntry() params ([1603410](https://github.com/peerigon/clockodo/commit/1603410eb6be6cbb85693ed08874f2541d91b225))
-- Make billable required again for addEntry() ([dda2bc8](https://github.com/peerigon/clockodo/commit/dda2bc8a004ba5966fa329952475d4ba96717cfb))
-- typo ([6c4810c](https://github.com/peerigon/clockodo/commit/6c4810c7b95d9272876eac2c2c5b1617c885f03e))
-- **Types:** Make running-propety in return types optional ([7b83d14](https://github.com/peerigon/clockodo/commit/7b83d1465625a803aeabad5376f575dd2297a799))
-- Required params in addLumpSumEntry ([fae42f8](https://github.com/peerigon/clockodo/commit/fae42f84afbaedb13dac56afa380d2d468753cc2))
+- billable not required when calling addEntry() with a lumpsum entry ([f422119](https://github.com/peerigon/clockodo/commit/f422119df88cc976c41103dea11400b4549211fb))
+- Incorrect addEntry() params ([1603410](https://github.com/peerigon/clockodo/commit/1603410eb6be6cbb85693ed08874f2541d91b225))
+- Make billable required again for addEntry() ([dda2bc8](https://github.com/peerigon/clockodo/commit/dda2bc8a004ba5966fa329952475d4ba96717cfb))
+- typo ([6c4810c](https://github.com/peerigon/clockodo/commit/6c4810c7b95d9272876eac2c2c5b1617c885f03e))
+- **Types:** Make running-propety in return types optional ([7b83d14](https://github.com/peerigon/clockodo/commit/7b83d1465625a803aeabad5376f575dd2297a799))
+- Required params in addLumpSumEntry ([fae42f8](https://github.com/peerigon/clockodo/commit/fae42f84afbaedb13dac56afa380d2d468753cc2))
### chore
-- Drop official support for Node 8 ([668decf](https://github.com/peerigon/clockodo/commit/668decf7ceedb6f628338e024e564d9f0d35b992))
+- Drop official support for Node 8 ([668decf](https://github.com/peerigon/clockodo/commit/668decf7ceedb6f628338e024e564d9f0d35b992))
### Features
-- Improve query and property mapping ([6dadcd0](https://github.com/peerigon/clockodo/commit/6dadcd0e9d9f80900a9f83dacfbd20cd949d08cd)), closes [#52](https://github.com/peerigon/clockodo/issues/52) [#60](https://github.com/peerigon/clockodo/issues/60)
-- Merge addLumpEntry with addEntry() ([825b72e](https://github.com/peerigon/clockodo/commit/825b72ea6245108fe0e67586503f6edaebf954f2))
+- Improve query and property mapping ([6dadcd0](https://github.com/peerigon/clockodo/commit/6dadcd0e9d9f80900a9f83dacfbd20cd949d08cd)), closes [#52](https://github.com/peerigon/clockodo/issues/52) [#60](https://github.com/peerigon/clockodo/issues/60)
+- Merge addLumpEntry with addEntry() ([825b72e](https://github.com/peerigon/clockodo/commit/825b72ea6245108fe0e67586503f6edaebf954f2))
-- Update esLint and use lint-staged + prettier ([74abf23](https://github.com/peerigon/clockodo/commit/74abf23a2210590d9e14287962f9bce76f656797))
+- Update esLint and use lint-staged + prettier ([74abf23](https://github.com/peerigon/clockodo/commit/74abf23a2210590d9e14287962f9bce76f656797))
### BREAKING CHANGES
-- The mapping between camelCase and snake_case has been streamlined and improved. You might observe different behavior if you relied on the previous (buggy) implementation.
-- Our test pipeline does not execute our tests for Node 8 anymore. There is no breaking change we know of but we don't guarantee that it will work on Node 8.
-- The Clockodo class uses arrow functions as methods.
-- addLumpEntry() has been removed. You can use addEntry() to create a recurring lump sum entry.
-- addEntry() actually requires different params based on what type of entry you want to create. If you want to create a time entry, you need to pass timeUntil. If you want to create a lump sum entry, you need to pass a lumpSum.
-- The required params of addLumpSumEntry() where not correct. The actual required params are: "customersId", "lumpSumsAmount", "lumpSumsId", "billable", "timeSince". These need to be passed as first argument. All additional params need to be passed as second argument.
+- The mapping between camelCase and snake_case has been streamlined and improved. You might observe different behavior if you relied on the previous (buggy) implementation.
+- Our test pipeline does not execute our tests for Node 8 anymore. There is no breaking change we know of but we don't guarantee that it will work on Node 8.
+- The Clockodo class uses arrow functions as methods.
+- addLumpEntry() has been removed. You can use addEntry() to create a recurring lump sum entry.
+- addEntry() actually requires different params based on what type of entry you want to create. If you want to create a time entry, you need to pass timeUntil. If you want to create a lump sum entry, you need to pass a lumpSum.
+- The required params of addLumpSumEntry() where not correct. The actual required params are: "customersId", "lumpSumsAmount", "lumpSumsId", "billable", "timeSince". These need to be passed as first argument. All additional params need to be passed as second argument.
# [7.0.0-beta.8](https://github.com/peerigon/clockodo/compare/v7.0.0-beta.7...v7.0.0-beta.8) (2020-12-01)
### Features
-- Improve query and property mapping ([6dadcd0](https://github.com/peerigon/clockodo/commit/6dadcd0e9d9f80900a9f83dacfbd20cd949d08cd)), closes [#52](https://github.com/peerigon/clockodo/issues/52) [#60](https://github.com/peerigon/clockodo/issues/60)
+- Improve query and property mapping ([6dadcd0](https://github.com/peerigon/clockodo/commit/6dadcd0e9d9f80900a9f83dacfbd20cd949d08cd)), closes [#52](https://github.com/peerigon/clockodo/issues/52) [#60](https://github.com/peerigon/clockodo/issues/60)
### BREAKING CHANGES
-- The mapping between camelCase and snake_case has been streamlined and improved. You might observe different behavior if you relied on the previous (buggy) implementation.
+- The mapping between camelCase and snake_case has been streamlined and improved. You might observe different behavior if you relied on the previous (buggy) implementation.
# [7.0.0-beta.7](https://github.com/peerigon/clockodo/compare/v7.0.0-beta.6...v7.0.0-beta.7) (2020-09-16)
### chore
-- Drop official support for Node 8 ([668decf](https://github.com/peerigon/clockodo/commit/668decf7ceedb6f628338e024e564d9f0d35b992))
+- Drop official support for Node 8 ([668decf](https://github.com/peerigon/clockodo/commit/668decf7ceedb6f628338e024e564d9f0d35b992))
### Features
-- Improve query and property mapping ([6dadcd0](https://github.com/peerigon/clockodo/commit/6dadcd0e9d9f80900a9f83dacfbd20cd949d08cd)), closes [#52](https://github.com/peerigon/clockodo/issues/52) [#60](https://github.com/peerigon/clockodo/issues/60)
-- Merge addLumpEntry with addEntry() ([825b72e](https://github.com/peerigon/clockodo/commit/825b72ea6245108fe0e67586503f6edaebf954f2))
+- Improve query and property mapping ([6dadcd0](https://github.com/peerigon/clockodo/commit/6dadcd0e9d9f80900a9f83dacfbd20cd949d08cd)), closes [#52](https://github.com/peerigon/clockodo/issues/52) [#60](https://github.com/peerigon/clockodo/issues/60)
+- Merge addLumpEntry with addEntry() ([825b72e](https://github.com/peerigon/clockodo/commit/825b72ea6245108fe0e67586503f6edaebf954f2))
-- Update esLint and use lint-staged + prettier ([74abf23](https://github.com/peerigon/clockodo/commit/74abf23a2210590d9e14287962f9bce76f656797))
+- Update esLint and use lint-staged + prettier ([74abf23](https://github.com/peerigon/clockodo/commit/74abf23a2210590d9e14287962f9bce76f656797))
### BREAKING CHANGES
-- The mapping between camelCase and snake_case has been streamlined and improved. You might observe different behavior if you relied on the previous (buggy) implementation.
-- Our test pipeline does not execute our tests for Node 8 anymore. There is no breaking change we know of but we don't guarantee that it will work on Node 8.
-- The Clockodo class uses arrow functions as methods.
-- addLumpEntry() has been removed. You can use addEntry() to create a recurring lump sum entry.
-- addEntry() actually requires different params based on what type of entry you want to create. If you want to create a time entry, you need to pass timeUntil. If you want to create a lump sum entry, you need to pass a lumpSum.
-- The required params of addLumpSumEntry() where not correct. The actual required params are: "customersId", "lumpSumsAmount", "lumpSumsId", "billable", "timeSince". These need to be passed as first argument. All additional params need to be passed as second argument.
+- The mapping between camelCase and snake_case has been streamlined and improved. You might observe different behavior if you relied on the previous (buggy) implementation.
+- Our test pipeline does not execute our tests for Node 8 anymore. There is no breaking change we know of but we don't guarantee that it will work on Node 8.
+- The Clockodo class uses arrow functions as methods.
+- addLumpEntry() has been removed. You can use addEntry() to create a recurring lump sum entry.
+- addEntry() actually requires different params based on what type of entry you want to create. If you want to create a time entry, you need to pass timeUntil. If you want to create a lump sum entry, you need to pass a lumpSum.
+- The required params of addLumpSumEntry() where not correct. The actual required params are: "customersId", "lumpSumsAmount", "lumpSumsId", "billable", "timeSince". These need to be passed as first argument. All additional params need to be passed as second argument.
# [7.0.0-beta.8](https://github.com/peerigon/clockodo/compare/v7.0.0-beta.7...v7.0.0-beta.8) (2020-12-01)
### Features
-- Improve query and property mapping ([6dadcd0](https://github.com/peerigon/clockodo/commit/6dadcd0e9d9f80900a9f83dacfbd20cd949d08cd)), closes [#52](https://github.com/peerigon/clockodo/issues/52) [#60](https://github.com/peerigon/clockodo/issues/60)
+- Improve query and property mapping ([6dadcd0](https://github.com/peerigon/clockodo/commit/6dadcd0e9d9f80900a9f83dacfbd20cd949d08cd)), closes [#52](https://github.com/peerigon/clockodo/issues/52) [#60](https://github.com/peerigon/clockodo/issues/60)
### BREAKING CHANGES
-- The mapping between camelCase and snake_case has been streamlined and improved. You might observe different behavior if you relied on the previous (buggy) implementation.
+- The mapping between camelCase and snake_case has been streamlined and improved. You might observe different behavior if you relied on the previous (buggy) implementation.
# [7.0.0-beta.7](https://github.com/peerigon/clockodo/compare/v7.0.0-beta.6...v7.0.0-beta.7) (2020-09-16)
### chore
-- Drop official support for Node 8 ([668decf](https://github.com/peerigon/clockodo/commit/668decf7ceedb6f628338e024e564d9f0d35b992))
+- Drop official support for Node 8 ([668decf](https://github.com/peerigon/clockodo/commit/668decf7ceedb6f628338e024e564d9f0d35b992))
### BREAKING CHANGES
-- Our test pipeline does not execute our tests for Node 8 anymore. There is no breaking change we know of but we don't guarantee that it will work on Node 8.
+- Our test pipeline does not execute our tests for Node 8 anymore. There is no breaking change we know of but we don't guarantee that it will work on Node 8.
# [7.0.0-beta.6](https://github.com/peerigon/clockodo/compare/v7.0.0-beta.5...v7.0.0-beta.6) (2020-09-16)
-- Update esLint and use lint-staged + prettier ([74abf23](https://github.com/peerigon/clockodo/commit/74abf23a2210590d9e14287962f9bce76f656797))
+- Update esLint and use lint-staged + prettier ([74abf23](https://github.com/peerigon/clockodo/commit/74abf23a2210590d9e14287962f9bce76f656797))
### BREAKING CHANGES
-- The Clockodo class uses arrow functions as methods.
+- The Clockodo class uses arrow functions as methods.
# [7.0.0-beta.5](https://github.com/peerigon/clockodo/compare/v7.0.0-beta.4...v7.0.0-beta.5) (2020-09-14)
### Bug Fixes
-- Make billable required again for addEntry() ([dda2bc8](https://github.com/peerigon/clockodo/commit/dda2bc8a004ba5966fa329952475d4ba96717cfb))
+- Make billable required again for addEntry() ([dda2bc8](https://github.com/peerigon/clockodo/commit/dda2bc8a004ba5966fa329952475d4ba96717cfb))
# [7.0.0-beta.4](https://github.com/peerigon/clockodo/compare/v7.0.0-beta.3...v7.0.0-beta.4) (2020-09-14)
### Bug Fixes
-- billable not required when calling addEntry() with a lumpsum entry ([f422119](https://github.com/peerigon/clockodo/commit/f422119df88cc976c41103dea11400b4549211fb))
-- **Types:** Make running-propety in return types optional ([7b83d14](https://github.com/peerigon/clockodo/commit/7b83d1465625a803aeabad5376f575dd2297a799))
+- billable not required when calling addEntry() with a lumpsum entry ([f422119](https://github.com/peerigon/clockodo/commit/f422119df88cc976c41103dea11400b4549211fb))
+- **Types:** Make running-propety in return types optional ([7b83d14](https://github.com/peerigon/clockodo/commit/7b83d1465625a803aeabad5376f575dd2297a799))
# [7.0.0-beta.3](https://github.com/peerigon/clockodo/compare/v7.0.0-beta.2...v7.0.0-beta.3) (2020-09-14)
### Features
-- Merge addLumpEntry with addEntry() ([825b72e](https://github.com/peerigon/clockodo/commit/825b72ea6245108fe0e67586503f6edaebf954f2))
+- Merge addLumpEntry with addEntry() ([825b72e](https://github.com/peerigon/clockodo/commit/825b72ea6245108fe0e67586503f6edaebf954f2))
### BREAKING CHANGES
-- addLumpEntry() has been removed. You can use addEntry() to create a recurring lump sum entry.
+- addLumpEntry() has been removed. You can use addEntry() to create a recurring lump sum entry.
# [7.0.0-beta.2](https://github.com/peerigon/clockodo/compare/v7.0.0-beta.1...v7.0.0-beta.2) (2020-09-14)
### Bug Fixes
-- Incorrect addEntry() params ([1603410](https://github.com/peerigon/clockodo/commit/1603410eb6be6cbb85693ed08874f2541d91b225))
+- Incorrect addEntry() params ([1603410](https://github.com/peerigon/clockodo/commit/1603410eb6be6cbb85693ed08874f2541d91b225))
### BREAKING CHANGES
-- addEntry() actually requires different params based on what type of entry you want to create. If you want to create a time entry, you need to pass timeUntil. If you want to create a lump sum entry, you need to pass a lumpSum.
+- addEntry() actually requires different params based on what type of entry you want to create. If you want to create a time entry, you need to pass timeUntil. If you want to create a lump sum entry, you need to pass a lumpSum.
# [7.0.0-beta.1](https://github.com/peerigon/clockodo/compare/v6.0.2...v7.0.0-beta.1) (2020-09-14)
### Bug Fixes
-- Required params in addLumpSumEntry ([fae42f8](https://github.com/peerigon/clockodo/commit/fae42f84afbaedb13dac56afa380d2d468753cc2))
+- Required params in addLumpSumEntry ([fae42f8](https://github.com/peerigon/clockodo/commit/fae42f84afbaedb13dac56afa380d2d468753cc2))
### BREAKING CHANGES
-- The required params of addLumpSumEntry() where not correct. The actual required params are: "customersId", "lumpSumsAmount", "lumpSumsId", "billable", "timeSince". These need to be passed as first argument. All additional params need to be passed as second argument.
+- The required params of addLumpSumEntry() where not correct. The actual required params are: "customersId", "lumpSumsAmount", "lumpSumsId", "billable", "timeSince". These need to be passed as first argument. All additional params need to be passed as second argument.
## [6.0.2](https://github.com/peerigon/clockodo/compare/v6.0.1...v6.0.2) (2020-09-14)
### Bug Fixes
-- Remove const enums ([dfda203](https://github.com/peerigon/clockodo/commit/dfda203decd3c4a03b7cfa6ccd2276704fcc6ef7))
+- Remove const enums ([dfda203](https://github.com/peerigon/clockodo/commit/dfda203decd3c4a03b7cfa6ccd2276704fcc6ef7))
## [6.0.2-beta.1](https://github.com/peerigon/clockodo/compare/v6.0.1...v6.0.2-beta.1) (2020-09-08)
### Bug Fixes
-- Remove const enums ([dfda203](https://github.com/peerigon/clockodo/commit/dfda203decd3c4a03b7cfa6ccd2276704fcc6ef7))
+- Remove const enums ([dfda203](https://github.com/peerigon/clockodo/commit/dfda203decd3c4a03b7cfa6ccd2276704fcc6ef7))
## [6.0.1](https://github.com/peerigon/clockodo/compare/v6.0.0...v6.0.1) (2020-07-13)
### Bug Fixes
-- Add plugins to npm package ([65a14ad](https://github.com/peerigon/clockodo/commit/65a14ad8e9d51c9f473dbd8e1f0dae8760e11aa8))
+- Add plugins to npm package ([65a14ad](https://github.com/peerigon/clockodo/commit/65a14ad8e9d51c9f473dbd8e1f0dae8760e11aa8))
# [6.0.0](https://github.com/peerigon/clockodo/compare/v5.0.0...v6.0.0) (2020-07-10)
### Features
-- API improvements ([1549b51](https://github.com/peerigon/clockodo/commit/1549b51f57a274e384b55e90ca134e02702e158a))
+- API improvements ([1549b51](https://github.com/peerigon/clockodo/commit/1549b51f57a274e384b55e90ca134e02702e158a))
### BREAKING CHANGES
-- Adjust all keys to match clockodos rest-api
+- Adjust all keys to match clockodos rest-api
# [5.0.0](https://github.com/peerigon/clockodo/compare/v4.1.0...v5.0.0) (2020-07-10)
### Features
-- Reduce bundle size by making caching optional ([b307bec](https://github.com/peerigon/clockodo/commit/b307bec0104daf4e2f0a4978e69cf73b3e812690))
+- Reduce bundle size by making caching optional ([b307bec](https://github.com/peerigon/clockodo/commit/b307bec0104daf4e2f0a4978e69cf73b3e812690))
### BREAKING CHANGES
-- The `cacheTime` option has been removed and replaced by a plugin interface. See README for more details.
+- The `cacheTime` option has been removed and replaced by a plugin interface. See README for more details.
# [4.1.0](https://github.com/peerigon/clockodo/compare/v4.0.1...v4.1.0) (2020-01-31)
### Features
-- **api:** introduce optional request caching ([a13ca28](https://github.com/peerigon/clockodo/commit/a13ca28))
-- **api:** introduce optional request caching ([71d6d09](https://github.com/peerigon/clockodo/commit/71d6d09))
+- **api:** introduce optional request caching ([a13ca28](https://github.com/peerigon/clockodo/commit/a13ca28))
+- **api:** introduce optional request caching ([71d6d09](https://github.com/peerigon/clockodo/commit/71d6d09))
## [4.0.1](https://github.com/peerigon/clockodo/compare/v4.0.0...v4.0.1) (2020-01-31)
### Bug Fixes
-- **readme:** adjust readme ([b8bf135](https://github.com/peerigon/clockodo/commit/b8bf135))
+- **readme:** adjust readme ([b8bf135](https://github.com/peerigon/clockodo/commit/b8bf135))
# Changelog
@@ -657,11 +593,11 @@ All notable changes to this project will be documented in this file. See [standa
### Bug Fixes
-- Change id type from string to number ([0513722](https://github.com/peerigon/clockodo/commit/0513722))
+- Change id type from string to number ([0513722](https://github.com/peerigon/clockodo/commit/0513722))
### BREAKING CHANGES
-- Clockodo REST API uses type number for ids.
+- Clockodo REST API uses type number for ids.
## [3.2.0](https://github.com/peerigon/clockodo/compare/v3.1.6...v3.2.0) (2019-12-17)
@@ -679,7 +615,7 @@ All notable changes to this project will be documented in this file. See [standa
### Bug Fixes
-- removes dangerous and unneeded dependencies ([6436399](https://github.com/peerigon/clockodo/commit/6436399))
+- removes dangerous and unneeded dependencies ([6436399](https://github.com/peerigon/clockodo/commit/6436399))
@@ -687,7 +623,7 @@ All notable changes to this project will be documented in this file. See [standa
### Bug Fixes
-- Array in Request Params ([#26](https://github.com/peerigon/clockodo/issues/26)) ([055de86](https://github.com/peerigon/clockodo/commit/055de86))
+- Array in Request Params ([#26](https://github.com/peerigon/clockodo/issues/26)) ([055de86](https://github.com/peerigon/clockodo/commit/055de86))
@@ -699,84 +635,84 @@ All notable changes to this project will be documented in this file. See [standa
### Features
-- Add target hours ([#22](https://github.com/peerigon/clockodo/issues/22)) ([ec25b66](https://github.com/peerigon/clockodo/commit/ec25b66))
+- Add target hours ([#22](https://github.com/peerigon/clockodo/issues/22)) ([ec25b66](https://github.com/peerigon/clockodo/commit/ec25b66))
# [3.0.0](https://github.com/peerigon/clockodo/compare/v1.1.1...v3.0.0) (2018-10-17)
-- Conversion to Typescript (#16) ([1bedec1](https://github.com/peerigon/clockodo/commit/1bedec1)), closes [#16](https://github.com/peerigon/clockodo/issues/16)
+- Conversion to Typescript (#16) ([1bedec1](https://github.com/peerigon/clockodo/commit/1bedec1)), closes [#16](https://github.com/peerigon/clockodo/issues/16)
### Bug Fixes
-- fixes outdate files option in package.json ([4a9f98e](https://github.com/peerigon/clockodo/commit/4a9f98e))
+- fixes outdate files option in package.json ([4a9f98e](https://github.com/peerigon/clockodo/commit/4a9f98e))
### Features
-- adding function parameter types ([#21](https://github.com/peerigon/clockodo/issues/21)) ([f3c2499](https://github.com/peerigon/clockodo/commit/f3c2499))
-- Adds remaining endpoint methods and alters old method signatures ([#14](https://github.com/peerigon/clockodo/issues/14)) ([fb82c71](https://github.com/peerigon/clockodo/commit/fb82c71)), closes [#12](https://github.com/peerigon/clockodo/issues/12)
+- adding function parameter types ([#21](https://github.com/peerigon/clockodo/issues/21)) ([f3c2499](https://github.com/peerigon/clockodo/commit/f3c2499))
+- Adds remaining endpoint methods and alters old method signatures ([#14](https://github.com/peerigon/clockodo/issues/14)) ([fb82c71](https://github.com/peerigon/clockodo/commit/fb82c71)), closes [#12](https://github.com/peerigon/clockodo/issues/12)
### BREAKING CHANGES
-- 2.0.0 was missing all of the code in its publication due to an outdated files value.
-- Method Signature structure has been completely changed, and Node 6 support is dropped.
+- 2.0.0 was missing all of the code in its publication due to an outdated files value.
+- Method Signature structure has been completely changed, and Node 6 support is dropped.
-- fix: addresses security vulnerabilities. Also adds jsdoc-to-markdown dev dependency
+- fix: addresses security vulnerabilities. Also adds jsdoc-to-markdown dev dependency
-- fix: jsdoc-to-markdown should just be used globally. removed dependency
+- fix: jsdoc-to-markdown should just be used globally. removed dependency
-- changes method signatures, adds useless jsdoc
+- changes method signatures, adds useless jsdoc
-- feat: creates config for typescript
+- feat: creates config for typescript
-- feat: converts files to typescript (and required changes that comes with the transformation)
+- feat: converts files to typescript (and required changes that comes with the transformation)
-- fix: fixes tests and the bugs revealed from them
+- fix: fixes tests and the bugs revealed from them
-- fix: updates integration test
+- fix: updates integration test
-- fix: adds nock teardown in case it is influencing other test files
+- fix: adds nock teardown in case it is influencing other test files
-- feat: upgrades min supported version to Node 8
+- feat: upgrades min supported version to Node 8
-- chore: sets automatic generation of types files to false as I see no benefit
-- Method signatures have been changed to objects.
+- chore: sets automatic generation of types files to false as I see no benefit
+- Method signatures have been changed to objects.
# [2.0.0](https://github.com/peerigon/clockodo/compare/v1.1.1...v2.0.0) (2018-10-17)
-- Conversion to Typescript (#16) ([1bedec1](https://github.com/peerigon/clockodo/commit/1bedec1)), closes [#16](https://github.com/peerigon/clockodo/issues/16)
+- Conversion to Typescript (#16) ([1bedec1](https://github.com/peerigon/clockodo/commit/1bedec1)), closes [#16](https://github.com/peerigon/clockodo/issues/16)
### Features
-- adding function parameter types ([#21](https://github.com/peerigon/clockodo/issues/21)) ([f3c2499](https://github.com/peerigon/clockodo/commit/f3c2499))
-- Adds remaining endpoint methods and alters old method signatures ([#14](https://github.com/peerigon/clockodo/issues/14)) ([fb82c71](https://github.com/peerigon/clockodo/commit/fb82c71)), closes [#12](https://github.com/peerigon/clockodo/issues/12)
+- adding function parameter types ([#21](https://github.com/peerigon/clockodo/issues/21)) ([f3c2499](https://github.com/peerigon/clockodo/commit/f3c2499))
+- Adds remaining endpoint methods and alters old method signatures ([#14](https://github.com/peerigon/clockodo/issues/14)) ([fb82c71](https://github.com/peerigon/clockodo/commit/fb82c71)), closes [#12](https://github.com/peerigon/clockodo/issues/12)
### BREAKING CHANGES
-- Method Signature structure has been completely changed, and Node 6 support is dropped.
+- Method Signature structure has been completely changed, and Node 6 support is dropped.
-- fix: addresses security vulnerabilities. Also adds jsdoc-to-markdown dev dependency
+- fix: addresses security vulnerabilities. Also adds jsdoc-to-markdown dev dependency
-- fix: jsdoc-to-markdown should just be used globally. removed dependency
+- fix: jsdoc-to-markdown should just be used globally. removed dependency
-- changes method signatures, adds useless jsdoc
+- changes method signatures, adds useless jsdoc
-- feat: creates config for typescript
+- feat: creates config for typescript
-- feat: converts files to typescript (and required changes that comes with the transformation)
+- feat: converts files to typescript (and required changes that comes with the transformation)
-- fix: fixes tests and the bugs revealed from them
+- fix: fixes tests and the bugs revealed from them
-- fix: updates integration test
+- fix: updates integration test
-- fix: adds nock teardown in case it is influencing other test files
+- fix: adds nock teardown in case it is influencing other test files
-- feat: upgrades min supported version to Node 8
+- feat: upgrades min supported version to Node 8
-- chore: sets automatic generation of types files to false as I see no benefit
-- Method signatures have been changed to objects.
+- chore: sets automatic generation of types files to false as I see no benefit
+- Method signatures have been changed to objects.
@@ -788,7 +724,7 @@ All notable changes to this project will be documented in this file. See [standa
### Features
-- Adds startClock, stopClock, and changeClockDuration ([5db9894](https://github.com/peerigon/clockodo/commit/5db9894))
+- Adds startClock, stopClock, and changeClockDuration ([5db9894](https://github.com/peerigon/clockodo/commit/5db9894))
@@ -796,4 +732,4 @@ All notable changes to this project will be documented in this file. See [standa
### Features
-- Add node 6 compatibility ([#5](https://github.com/peerigon/clockodo/issues/5)) ([fe01101](https://github.com/peerigon/clockodo/commit/fe01101))
+- Add node 6 compatibility ([#5](https://github.com/peerigon/clockodo/issues/5)) ([fe01101](https://github.com/peerigon/clockodo/commit/fe01101))
diff --git a/README.md b/README.md
index 8bb6ca2a..87af99ad 100644
--- a/README.md
+++ b/README.md
@@ -721,18 +721,6 @@ await clockodo.stopClock({ entriesId: 7082 });
---
-## ⚠️ Deprecated: Caching
-
-> ⚠️ This feature relies on an axios plugin and will be removed as soon as we move from axios to fetch(). It is only listed for documentation purposes.
-
-It is also possible to create a Clockodo instance with **caching**. This means the request responses are cached until a `POST`, `PUT`, `DELETE` or `PATCH` is send to the very same url or the cache time is over.
-
-```js
-import { cachePlugin } from "clockodo/plugins/cache";
-
-clockodo.use(cachePlugin({ cacheTime: 15 * 60 * 1000 })); // cache of 15 minutes
-```
-
## Development
To run integration tests you need to create an `.env` by copying the `.env.example` and entering credentials of a dev-user, as you don't want to mess up your real clockodo data.
diff --git a/package-lock.json b/package-lock.json
index 2dfed078..536bc5bc 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -10,17 +10,16 @@
"license": "MIT",
"dependencies": {
"@faker-js/faker": "^6.1.1",
- "axios": "^0.21.4",
- "axios-cache-adapter": "^2.7.3",
"map-obj": "^4.3.0",
+ "node-fetch": "^2.6.7",
"qs": "^6.10.1"
},
"devDependencies": {
"@semantic-release/changelog": "^6.0.1",
"@semantic-release/git": "^10.0.1",
- "@types/faker": "^5.5.9",
"@types/jest": "^27.0.2",
"@types/node": "^16.11.7",
+ "@types/node-fetch": "^2.6.1",
"@types/qs": "^6.9.7",
"copyfiles": "^2.4.1",
"cross-env": "^7.0.3",
@@ -1629,12 +1628,6 @@
"@babel/types": "^7.3.0"
}
},
- "node_modules/@types/faker": {
- "version": "5.5.9",
- "resolved": "https://registry.npmjs.org/@types/faker/-/faker-5.5.9.tgz",
- "integrity": "sha512-uCx6mP3UY5SIO14XlspxsGjgaemrxpssJI0Ol+GfhxtcKpv9pgRZYsS4eeKeHVLje6Qtc8lGszuBI461+gVZBA==",
- "dev": true
- },
"node_modules/@types/graceful-fs": {
"version": "4.1.5",
"resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.5.tgz",
@@ -1702,6 +1695,16 @@
"integrity": "sha512-QB5D2sqfSjCmTuWcBWyJ+/44bcjO7VbjSbOE0ucoVbAsSNQc4Lt6QkgkVXkTDwkL4z/beecZNDvVX15D4P8Jbw==",
"dev": true
},
+ "node_modules/@types/node-fetch": {
+ "version": "2.6.1",
+ "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.1.tgz",
+ "integrity": "sha512-oMqjURCaxoSIsHSr1E47QHzbmzNR5rK8McHuNb11BOM9cHcIK3Avy0s/b2JlXHoQGTYS3NsvWzV1M0iK7l0wbA==",
+ "dev": true,
+ "dependencies": {
+ "@types/node": "*",
+ "form-data": "^3.0.0"
+ }
+ },
"node_modules/@types/normalize-package-data": {
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz",
@@ -2215,26 +2218,6 @@
"node": ">= 4.0.0"
}
},
- "node_modules/axios": {
- "version": "0.21.4",
- "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz",
- "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==",
- "dependencies": {
- "follow-redirects": "^1.14.0"
- }
- },
- "node_modules/axios-cache-adapter": {
- "version": "2.7.3",
- "resolved": "https://registry.npmjs.org/axios-cache-adapter/-/axios-cache-adapter-2.7.3.tgz",
- "integrity": "sha512-A+ZKJ9lhpjthOEp4Z3QR/a9xC4du1ALaAsejgRGrH9ef6kSDxdFrhRpulqsh9khsEnwXxGfgpUuDp1YXMNMEiQ==",
- "dependencies": {
- "cache-control-esm": "1.0.0",
- "md5": "^2.2.1"
- },
- "peerDependencies": {
- "axios": "~0.21.1"
- }
- },
"node_modules/babel-jest": {
"version": "27.3.1",
"resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-27.3.1.tgz",
@@ -2448,11 +2431,6 @@
"integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==",
"dev": true
},
- "node_modules/cache-control-esm": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/cache-control-esm/-/cache-control-esm-1.0.0.tgz",
- "integrity": "sha512-Fa3UV4+eIk4EOih8FTV6EEsVKO0W5XWtNs6FC3InTfVz+EjurjPfDXY5wZDo/lxjDxg5RjNcurLyxEJBcEUx9g=="
- },
"node_modules/call-bind": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz",
@@ -2534,14 +2512,6 @@
"node": ">=10"
}
},
- "node_modules/charenc": {
- "version": "0.0.2",
- "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz",
- "integrity": "sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc=",
- "engines": {
- "node": "*"
- }
- },
"node_modules/ci-info": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.2.0.tgz",
@@ -2978,14 +2948,6 @@
"node": ">= 8"
}
},
- "node_modules/crypt": {
- "version": "0.0.2",
- "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz",
- "integrity": "sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs=",
- "engines": {
- "node": "*"
- }
- },
"node_modules/crypto-random-string": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz",
@@ -4088,25 +4050,6 @@
"integrity": "sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw==",
"dev": true
},
- "node_modules/follow-redirects": {
- "version": "1.14.5",
- "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.5.tgz",
- "integrity": "sha512-wtphSXy7d4/OR+MvIFbCVBDzZ5520qV8XfPklSN5QtxuMUJZ+b0Wnst1e1lCDocfzuCkHqj8k0FpZqO+UIaKNA==",
- "funding": [
- {
- "type": "individual",
- "url": "https://github.com/sponsors/RubenVerborgh"
- }
- ],
- "engines": {
- "node": ">=4.0"
- },
- "peerDependenciesMeta": {
- "debug": {
- "optional": true
- }
- }
- },
"node_modules/form-data": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz",
@@ -4847,11 +4790,6 @@
"url": "https://github.com/sponsors/ljharb"
}
},
- "node_modules/is-buffer": {
- "version": "1.1.6",
- "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz",
- "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w=="
- },
"node_modules/is-callable": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz",
@@ -6395,16 +6333,6 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "node_modules/md5": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz",
- "integrity": "sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==",
- "dependencies": {
- "charenc": "0.0.2",
- "crypt": "0.0.2",
- "is-buffer": "~1.1.6"
- }
- },
"node_modules/memorystream": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz",
@@ -6700,34 +6628,38 @@
}
},
"node_modules/node-fetch": {
- "version": "2.6.6",
- "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.6.tgz",
- "integrity": "sha512-Z8/6vRlTUChSdIgMa51jxQ4lrw/Jy5SOW10ObaA47/RElsAN2c5Pn8bTgFGWn/ibwzXTE8qwr1Yzx28vsecXEA==",
- "dev": true,
+ "version": "2.6.7",
+ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
+ "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==",
"dependencies": {
"whatwg-url": "^5.0.0"
},
"engines": {
"node": "4.x || >=6.0.0"
+ },
+ "peerDependencies": {
+ "encoding": "^0.1.0"
+ },
+ "peerDependenciesMeta": {
+ "encoding": {
+ "optional": true
+ }
}
},
"node_modules/node-fetch/node_modules/tr46": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
- "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=",
- "dev": true
+ "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o="
},
"node_modules/node-fetch/node_modules/webidl-conversions": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
- "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=",
- "dev": true
+ "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE="
},
"node_modules/node-fetch/node_modules/whatwg-url": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
"integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=",
- "dev": true,
"dependencies": {
"tr46": "~0.0.3",
"webidl-conversions": "^3.0.0"
@@ -13511,12 +13443,6 @@
"@babel/types": "^7.3.0"
}
},
- "@types/faker": {
- "version": "5.5.9",
- "resolved": "https://registry.npmjs.org/@types/faker/-/faker-5.5.9.tgz",
- "integrity": "sha512-uCx6mP3UY5SIO14XlspxsGjgaemrxpssJI0Ol+GfhxtcKpv9pgRZYsS4eeKeHVLje6Qtc8lGszuBI461+gVZBA==",
- "dev": true
- },
"@types/graceful-fs": {
"version": "4.1.5",
"resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.5.tgz",
@@ -13584,6 +13510,16 @@
"integrity": "sha512-QB5D2sqfSjCmTuWcBWyJ+/44bcjO7VbjSbOE0ucoVbAsSNQc4Lt6QkgkVXkTDwkL4z/beecZNDvVX15D4P8Jbw==",
"dev": true
},
+ "@types/node-fetch": {
+ "version": "2.6.1",
+ "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.1.tgz",
+ "integrity": "sha512-oMqjURCaxoSIsHSr1E47QHzbmzNR5rK8McHuNb11BOM9cHcIK3Avy0s/b2JlXHoQGTYS3NsvWzV1M0iK7l0wbA==",
+ "dev": true,
+ "requires": {
+ "@types/node": "*",
+ "form-data": "^3.0.0"
+ }
+ },
"@types/normalize-package-data": {
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz",
@@ -13944,23 +13880,6 @@
"integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==",
"dev": true
},
- "axios": {
- "version": "0.21.4",
- "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz",
- "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==",
- "requires": {
- "follow-redirects": "^1.14.0"
- }
- },
- "axios-cache-adapter": {
- "version": "2.7.3",
- "resolved": "https://registry.npmjs.org/axios-cache-adapter/-/axios-cache-adapter-2.7.3.tgz",
- "integrity": "sha512-A+ZKJ9lhpjthOEp4Z3QR/a9xC4du1ALaAsejgRGrH9ef6kSDxdFrhRpulqsh9khsEnwXxGfgpUuDp1YXMNMEiQ==",
- "requires": {
- "cache-control-esm": "1.0.0",
- "md5": "^2.2.1"
- }
- },
"babel-jest": {
"version": "27.3.1",
"resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-27.3.1.tgz",
@@ -14133,11 +14052,6 @@
"integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==",
"dev": true
},
- "cache-control-esm": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/cache-control-esm/-/cache-control-esm-1.0.0.tgz",
- "integrity": "sha512-Fa3UV4+eIk4EOih8FTV6EEsVKO0W5XWtNs6FC3InTfVz+EjurjPfDXY5wZDo/lxjDxg5RjNcurLyxEJBcEUx9g=="
- },
"call-bind": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz",
@@ -14191,11 +14105,6 @@
"integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==",
"dev": true
},
- "charenc": {
- "version": "0.0.2",
- "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz",
- "integrity": "sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc="
- },
"ci-info": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.2.0.tgz",
@@ -14526,11 +14435,6 @@
"which": "^2.0.1"
}
},
- "crypt": {
- "version": "0.0.2",
- "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz",
- "integrity": "sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs="
- },
"crypto-random-string": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz",
@@ -15393,11 +15297,6 @@
"integrity": "sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw==",
"dev": true
},
- "follow-redirects": {
- "version": "1.14.5",
- "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.5.tgz",
- "integrity": "sha512-wtphSXy7d4/OR+MvIFbCVBDzZ5520qV8XfPklSN5QtxuMUJZ+b0Wnst1e1lCDocfzuCkHqj8k0FpZqO+UIaKNA=="
- },
"form-data": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz",
@@ -15938,11 +15837,6 @@
"has-tostringtag": "^1.0.0"
}
},
- "is-buffer": {
- "version": "1.1.6",
- "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz",
- "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w=="
- },
"is-callable": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz",
@@ -17123,16 +17017,6 @@
"escape-string-regexp": "^4.0.0"
}
},
- "md5": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz",
- "integrity": "sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==",
- "requires": {
- "charenc": "0.0.2",
- "crypt": "0.0.2",
- "is-buffer": "~1.1.6"
- }
- },
"memorystream": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz",
@@ -17355,10 +17239,9 @@
}
},
"node-fetch": {
- "version": "2.6.6",
- "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.6.tgz",
- "integrity": "sha512-Z8/6vRlTUChSdIgMa51jxQ4lrw/Jy5SOW10ObaA47/RElsAN2c5Pn8bTgFGWn/ibwzXTE8qwr1Yzx28vsecXEA==",
- "dev": true,
+ "version": "2.6.7",
+ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
+ "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==",
"requires": {
"whatwg-url": "^5.0.0"
},
@@ -17366,20 +17249,17 @@
"tr46": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
- "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=",
- "dev": true
+ "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o="
},
"webidl-conversions": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
- "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=",
- "dev": true
+ "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE="
},
"whatwg-url": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
"integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=",
- "dev": true,
"requires": {
"tr46": "~0.0.3",
"webidl-conversions": "^3.0.0"
diff --git a/package.json b/package.json
index 6ff0aab4..67aef0c0 100644
--- a/package.json
+++ b/package.json
@@ -42,6 +42,7 @@
"build:copy": "copyfiles -f ./src/*.mjs ./dist/cjs/",
"test": "run-p test:*",
"test:suite": "jest",
+ "test:suite:watch": "jest --watch",
"test:turkish": "cross-env LC_ALL=tr jest 'integration' -t 'using a Turkish locale'",
"test:lint": "eslint --max-warnings 0 --cache --ext js,ts --ignore-path .gitignore src",
"posttest": "run-s build",
@@ -65,9 +66,8 @@
"homepage": "https://github.com/peerigon/clockodo#readme",
"dependencies": {
"@faker-js/faker": "^6.1.1",
- "axios": "^0.21.4",
- "axios-cache-adapter": "^2.7.3",
"map-obj": "^4.3.0",
+ "node-fetch": "^2.6.7",
"qs": "^6.10.1"
},
"devDependencies": {
@@ -75,6 +75,7 @@
"@semantic-release/git": "^10.0.1",
"@types/jest": "^27.0.2",
"@types/node": "^16.11.7",
+ "@types/node-fetch": "^2.6.1",
"@types/qs": "^6.9.7",
"copyfiles": "^2.4.1",
"cross-env": "^7.0.3",
diff --git a/plugins/cache.js b/plugins/cache.js
deleted file mode 100644
index 57d1885a..00000000
--- a/plugins/cache.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require("../dist/cjs/plugins/cache.js");
diff --git a/plugins/cache.mjs b/plugins/cache.mjs
deleted file mode 100644
index 91359b43..00000000
--- a/plugins/cache.mjs
+++ /dev/null
@@ -1 +0,0 @@
-export { cachePlugin } from "../dist/esm/plugins/cache.js";
diff --git a/src/clockodo.test.ts b/src/clockodo.test.ts
index b8482d24..20159e12 100644
--- a/src/clockodo.test.ts
+++ b/src/clockodo.test.ts
@@ -11,7 +11,7 @@ import {
AbsenceStatus,
mapRequestBody,
} from "./index.js";
-import { cachePlugin } from "./plugins/cache.js";
+import { ApiResponseError } from "./lib/errors.js";
const CLOCKODO_API = "https://my.clockodo.com/api";
const config: Config = {
@@ -98,42 +98,34 @@ describe("Clockodo (instance)", () => {
});
});
- describe("Cache", () => {
- it("should cache the first request for cacheTime", async () => {
- const clockodoWithCache = new Clockodo(config);
+ describe("Custom Error Types", () => {
+ const obviouslyFakeId = 1000000000000001;
- clockodoWithCache.use(cachePlugin({ cacheTime: 50 }));
-
- const usersId = 7;
- let requestCounter = 0;
-
- const nockScope = nock(CLOCKODO_API)
- .get(`/users/${usersId}`)
- .twice()
- .reply(200, () => {
- requestCounter++;
-
- return {};
- });
-
- await clockodoWithCache.getUser({
- id: usersId,
+ // TODO: make the assertions actually match error obj, not just error type
+ it("returns an ApiResponseError on failed auth", async () => {
+ const apiError = new ApiResponseError(401, {
+ error: { message: "Authentication failed", fields: [] },
});
- expect(requestCounter).toBe(1);
- await clockodoWithCache.getUser({
- id: usersId,
- });
- // If cache is not working this would fail
- expect(requestCounter).toBe(1);
- await new Promise((resolve) => setTimeout(resolve, 50));
+ expect(
+ clockodo.getCustomer({ id: obviouslyFakeId })
+ ).rejects.toThrowError(apiError);
+ });
+ it("returns an ApiResponseError on 404", async () => {
+ clockodo.api.config({
+ authentication: {
+ user: process.env.CLOCKODO_USER!,
+ apiKey: process.env.CLOCKODO_API_KEY!,
+ },
+ });
- await clockodoWithCache.getUser({
- id: usersId,
+ const apiError = new ApiResponseError(404, {
+ error: { message: "The requested resource could not be found" },
});
- expect(requestCounter).toBe(2);
- nockScope.done();
+ expect(
+ clockodo.getCustomer({ id: obviouslyFakeId })
+ ).rejects.toThrowError(apiError);
});
});
diff --git a/src/index.ts b/src/index.ts
index 9c264fd3..885747af 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -13,6 +13,8 @@ export * from "./models/user.js";
export * from "./models/userReport.js";
export * from "./models/worktimeRegulation.js";
+export * from "./lib/apiErrors.js";
+
export {
mapQueryParams,
mapRequestBody,
diff --git a/src/lib/api.ts b/src/lib/api.ts
index d96199cb..5fa7c006 100644
--- a/src/lib/api.ts
+++ b/src/lib/api.ts
@@ -1,7 +1,8 @@
-import axios, { AxiosRequestConfig } from "axios";
+import fetch from "node-fetch";
import qs from "qs";
-import { axiosClient } from "./symbols.js";
+import { requestConfig } from "./symbols.js";
import { mapQueryParams, mapRequestBody, mapResponseBody } from "./mappings.js";
+import { ApiResponseError } from "./errors.js";
const DEFAULT_BASE_URL = "https://my.clockodo.com/api";
@@ -21,6 +22,11 @@ const paramsSerializer = (params: Record) => {
return urlParams.join("&");
};
+type FetchConfig = {
+ baseUrl: string | undefined;
+ headers: Record;
+};
+
export type Paging = {
itemsPerPage: number;
currentPage: number;
@@ -76,11 +82,10 @@ export type Config = {
};
export class Api {
- [axiosClient] = axios.create({
- headers: {
- "X-ClockodoEnableIsoUtcDateTimes": "1",
- },
- });
+ [requestConfig]: FetchConfig = {
+ baseUrl: undefined,
+ headers: {},
+ };
constructor({
baseUrl = DEFAULT_BASE_URL,
@@ -98,16 +103,21 @@ export class Api {
this.config({ client, authentication, baseUrl, locale });
}
+ // The fact that this can be called again was a source of great confusion. I had changed the if below to throw if (!baseUrl || typeof baseUrl !== "string"), but turns out sometimes we don't need it
config(config: Partial) {
- const defaults = this[axiosClient].defaults;
+ const request = this[requestConfig];
+
+ request.headers["X-ClockodoEnableIsoUtcDateTimes"] = "1";
if ("locale" in config) {
const { locale } = config;
if (locale === undefined) {
- delete defaults.headers["Accept-Language"];
+ // * from merge
+ delete request.headers["Accept-Language"];
} else if (typeof locale === "string") {
- defaults.headers["Accept-Language"] = locale;
+ // * from merge
+ request.headers["Accept-Language"] = locale;
} else {
throw createTypeError({
name: "locale",
@@ -121,9 +131,9 @@ export class Api {
const { baseUrl } = config;
if (baseUrl === undefined) {
- defaults.baseURL = DEFAULT_BASE_URL;
+ request.baseUrl = DEFAULT_BASE_URL;
} else if (typeof baseUrl === "string") {
- defaults.baseURL = baseUrl;
+ request.baseUrl = baseUrl;
} else {
throw createTypeError({
name: "baseUrl",
@@ -151,16 +161,18 @@ export class Api {
});
}
- defaults.headers["X-Clockodo-External-Application"] = `${name};${email}`;
+ request.headers["X-Clockodo-External-Application"] = `${name};${email}`;
}
+
if ("authentication" in config) {
const { authentication } = config;
if (authentication === undefined) {
- delete defaults.headers["X-ClockodoApiUser"];
- delete defaults.headers["X-ClockodoApiKey"];
- defaults.headers["X-Requested-With"] = "XMLHttpRequest";
- defaults.withCredentials = true;
+ delete request.headers["X-ClockodoApiUser"];
+ delete request.headers["X-ClockodoApiKey"];
+
+ request.headers["X-Requested-With"] = "XMLHttpRequest";
+ // defaults.withCredentials = true;
} else {
const { user, apiKey } = authentication;
@@ -179,72 +191,94 @@ export class Api {
});
}
- defaults.headers["X-ClockodoApiUser"] = user;
- defaults.headers["X-ClockodoApiKey"] = apiKey;
- delete defaults.headers["X-Requested-With"];
+ request.headers["X-ClockodoApiUser"] = user;
+ request.headers["X-ClockodoApiKey"] = apiKey;
+
+ delete request.headers["X-Requested-With"];
+
// Since we're sending auth headers now, it's not required to also send cookies.
- defaults.withCredentials = false;
+ // defaults.withCredentials = false;
}
}
}
- async get(
- url: string,
- queryParams = {},
- options?: AxiosRequestConfig
- ): Promise {
- const response = await this[axiosClient].get(url, {
- params: mapQueryParams(queryParams),
- paramsSerializer,
- ...options,
+ async get(url: string, queryParams = {}): Promise {
+ const params = paramsSerializer(mapQueryParams(queryParams));
+ const baseUrl = this[requestConfig].baseUrl;
+
+ const queryString = params ? `?${params}` : "";
+
+ const response = await fetch(`${baseUrl}${url}${queryString}`, {
+ method: "GET",
+ headers: this[requestConfig].headers,
});
+ const data = await response.json();
+
+ if (!response.ok) throw new ApiResponseError(response.status, data);
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
- return mapResponseBody(response.data);
+ return mapResponseBody(data);
}
- async post(
- url: string,
- body = {},
- options?: AxiosRequestConfig
- ): Promise {
- const response = await this[axiosClient].post(
- url,
- mapRequestBody(body),
- options
- );
+ async post(url: string, body = {}): Promise {
+ const baseUrl = this[requestConfig].baseUrl;
+
+ const response = await fetch(`${baseUrl}${url}`, {
+ method: "POST",
+ headers: {
+ ...this[requestConfig].headers,
+ "Content-Type": "application/json",
+ },
+ body: JSON.stringify(mapRequestBody(body)),
+ });
+
+ const data = await response.json();
+
+ if (!response.ok) throw new ApiResponseError(response.status, data);
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
- return mapResponseBody(response.data);
+ return mapResponseBody(data);
}
- async put(
- url: string,
- body = {},
- options?: AxiosRequestConfig
- ): Promise {
- const response = await this[axiosClient].put(
- url,
- mapRequestBody(body),
- options
- );
+ async put(url: string, body = {}): Promise {
+ const baseUrl = this[requestConfig].baseUrl;
+
+ const response = await fetch(`${baseUrl}${url}`, {
+ method: "PUT",
+ headers: {
+ ...this[requestConfig].headers,
+ "Content-Type": "application/json",
+ },
+ body: JSON.stringify(mapRequestBody(body)),
+ });
+
+ const data = await response.json();
+
+ if (!response.ok) throw new ApiResponseError(response.status, data);
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
- return mapResponseBody(response.data);
+ return mapResponseBody(data);
}
- async delete(
- url: string,
- body = {},
- options?: AxiosRequestConfig
- ): Promise {
- const response = await this[axiosClient].delete(url, {
- data: mapRequestBody(body),
- ...options,
+ async delete(url: string, body = {}): Promise {
+ const baseUrl = this[requestConfig].baseUrl;
+
+ const response = await fetch(`${baseUrl}${url}`, {
+ method: "DELETE",
+ headers: {
+ ...this[requestConfig].headers,
+ "Content-Type": "application/json",
+ },
+ body: JSON.stringify(mapRequestBody(body)),
});
+ const data = await response.json();
+
+ if (!response.ok) throw new ApiResponseError(response.status, data);
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
- return mapResponseBody(response.data);
+ return mapResponseBody(data);
}
}
diff --git a/src/lib/apiErrors.ts b/src/lib/apiErrors.ts
new file mode 100644
index 00000000..63669725
--- /dev/null
+++ b/src/lib/apiErrors.ts
@@ -0,0 +1,244 @@
+export enum ApiErrorCode {
+ /**
+ * In case we couldn't establish a connection to the server.
+ */
+ Disconnected = "Disconnected",
+
+ /**
+ * In case we didn't receive a response from the server within a given time span
+ */
+ Timeout = "Timeout",
+
+ /**
+ * In case the server responded with 429 - Too Many Requests
+ */
+ TooManyRequests = "TooManyRequests",
+
+ /**
+ * In case the server responded with 401 - Unauthorized
+ */
+ AuthenticationInvalid = "AuthenticationInvalid",
+
+ /**
+ * In case the server responded with 403 - Forbidden
+ */
+ Forbidden = "Forbidden",
+
+ /**
+ * In case the server responded with 423 - Locked
+ */
+ Locked = "Locked",
+
+ /**
+ * In case the server responded with 404 - Not Found
+ */
+ NotFound = "NotFound",
+
+ /**
+ * Catch-all error for all error codes < 500, including:
+ * - 400 - Bad Request
+ * - 409 - Conflict
+ * - 412 - Precondition Failed
+ */
+ BadRequest = "BadRequest",
+
+ /**
+ * Catch-all error for all error codes >= 500, including:
+ * - 500 - Internal Server Error
+ */
+ ServerError = "ServerError",
+
+ /**
+ * Catch-all error for any remaining error conditions.
+ */
+ UnknownError = "UnknownError",
+}
+
+const apiErrorCodes = Object.values(ApiErrorCode);
+const offlineApiErrorCodes = [ApiErrorCode.Disconnected, ApiErrorCode.Timeout];
+
+abstract class AbstractApiError<
+ GivenApiErrorCode extends ApiErrorCode
+> extends Error {
+ readonly code: GivenApiErrorCode;
+ readonly message: string;
+
+ constructor({
+ // Since we serializing and de-serializing error objects, these properties
+ // should be the same as the properties on the error instance
+ code,
+ message = code,
+ }: {
+ code: GivenApiErrorCode;
+ message?: string;
+ }) {
+ super(message);
+ this.code = code;
+ this.message = message;
+ }
+
+ // toJSON() gets called by JSON.stringify() automatically.
+ // It's supposed to return a serializable object.
+ // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#toJSON_behavior
+ toJSON() {
+ return {
+ ...this,
+ // Since 'message' is a non-enumerable property on the error object,
+ // we need to list it here explicitly.
+ message: this.message,
+ };
+ }
+}
+
+export class ApiErrorDisconnected extends AbstractApiError {
+ constructor({ message }: { message?: string } = {}) {
+ super({ message, code: ApiErrorCode.Disconnected });
+ }
+}
+
+export class ApiErrorTimeout extends AbstractApiError {
+ constructor({ message }: { message?: string } = {}) {
+ super({ message, code: ApiErrorCode.Timeout });
+ }
+}
+
+export class ApiErrorTooManyRequests extends AbstractApiError {
+ constructor({ message }: { message?: string } = {}) {
+ super({ message, code: ApiErrorCode.TooManyRequests });
+ }
+}
+
+export class ApiErrorAuthenticationInvalid extends AbstractApiError {
+ constructor({ message }: { message?: string } = {}) {
+ super({ message, code: ApiErrorCode.AuthenticationInvalid });
+ }
+}
+
+export class ApiErrorForbidden extends AbstractApiError {
+ constructor({ message }: { message?: string } = {}) {
+ super({ message, code: ApiErrorCode.Forbidden });
+ }
+}
+
+export class ApiErrorLocked extends AbstractApiError {
+ constructor({ message }: { message?: string } = {}) {
+ super({ message, code: ApiErrorCode.Locked });
+ }
+}
+
+export class ApiErrorNotFound extends AbstractApiError {
+ constructor({ message }: { message?: string } = {}) {
+ super({ message, code: ApiErrorCode.NotFound });
+ }
+}
+
+export class ApiErrorBadRequest extends AbstractApiError {
+ readonly fields: Array;
+
+ constructor({
+ message,
+ fields = [],
+ }: { message?: string; fields?: Array } = {}) {
+ super({ message, code: ApiErrorCode.BadRequest });
+
+ this.fields = fields;
+ }
+}
+
+export class ApiErrorServerError extends AbstractApiError {
+ constructor({ message }: { message?: string } = {}) {
+ super({ message, code: ApiErrorCode.ServerError });
+ }
+}
+
+export class ApiErrorUnknownError extends AbstractApiError {
+ constructor({ message }: { message?: string } = {}) {
+ super({ message, code: ApiErrorCode.UnknownError });
+ }
+}
+
+export type ApiError =
+ | ApiErrorDisconnected
+ | ApiErrorTimeout
+ | ApiErrorTooManyRequests
+ | ApiErrorAuthenticationInvalid
+ | ApiErrorLocked
+ | ApiErrorNotFound
+ | ApiErrorBadRequest
+ | ApiErrorServerError
+ | ApiErrorUnknownError;
+
+export const createErrorInstanceFromSerializedError = (
+ serializedError: Omit, "name" | "toJSON">
+): ApiError => {
+ switch (serializedError.code) {
+ case ApiErrorCode.Disconnected:
+ return new ApiErrorDisconnected(serializedError);
+ case ApiErrorCode.Timeout:
+ return new ApiErrorTimeout(serializedError);
+ case ApiErrorCode.TooManyRequests:
+ return new ApiErrorTooManyRequests(serializedError);
+ case ApiErrorCode.AuthenticationInvalid:
+ return new ApiErrorAuthenticationInvalid(serializedError);
+ case ApiErrorCode.Locked:
+ return new ApiErrorLocked(serializedError);
+ case ApiErrorCode.BadRequest:
+ return new ApiErrorBadRequest(serializedError);
+ case ApiErrorCode.NotFound:
+ return new ApiErrorNotFound(serializedError);
+ case ApiErrorCode.ServerError:
+ return new ApiErrorServerError(serializedError);
+ default:
+ return new ApiErrorUnknownError(serializedError);
+ }
+};
+
+export const isApiErrorCode = (code: any): code is ApiErrorCode => {
+ return apiErrorCodes.includes(code as ApiErrorCode);
+};
+
+export const isOfflineApiErrorCode = (
+ code: any
+): code is ApiErrorCode.Disconnected | ApiErrorCode.Timeout => {
+ return offlineApiErrorCodes.includes(code as ApiErrorCode);
+};
+
+export const createApiErrorFromFailedResponse = (
+ /** Pass undefined if the request failed without a response */
+ response: Response | undefined,
+ /** Parsed JSON response if available */
+ responseBody?: any
+) => {
+ if (response === undefined) return new ApiErrorDisconnected();
+
+ const message = getErrorMessageFromResponseBody(responseBody);
+
+ if (response.status === 401)
+ return new ApiErrorAuthenticationInvalid({ message });
+ if (response.status === 403) return new ApiErrorForbidden({ message });
+ if (response.status === 404) return new ApiErrorNotFound({ message });
+ if (response.status === 423) return new ApiErrorLocked({ message });
+ if (response.status === 429) return new ApiErrorTooManyRequests({ message });
+ if (response.status < 500)
+ return new ApiErrorBadRequest({
+ message,
+ fields: responseBody.error?.fields ?? [],
+ });
+ if (response.status >= 500) return new ApiErrorServerError({ message });
+
+ return new ApiErrorUnknownError({ message });
+};
+
+const getErrorMessageFromResponseBody = (responseBody: any) => {
+ let message: string = responseBody?.error?.message;
+
+ if (typeof message !== "string") return undefined;
+
+ const lastChar = message[message.length - 1];
+
+ if (lastChar !== ".") {
+ message = message + ".";
+ }
+
+ return message;
+};
diff --git a/src/lib/errors.ts b/src/lib/errors.ts
new file mode 100644
index 00000000..6030c2c3
--- /dev/null
+++ b/src/lib/errors.ts
@@ -0,0 +1,17 @@
+class BaseError extends Error {
+ constructor(message: string) {
+ super(message);
+ this.name = this.constructor.name;
+ }
+}
+
+export class ApiResponseError extends BaseError {
+ status;
+ body;
+
+ constructor(status: number, body: any) {
+ super("The Clockodo API returned an error status code");
+ this.status = status;
+ this.body = body;
+ }
+}
\ No newline at end of file
diff --git a/src/lib/symbols.ts b/src/lib/symbols.ts
index d7b3ba1b..c087ad26 100644
--- a/src/lib/symbols.ts
+++ b/src/lib/symbols.ts
@@ -1 +1 @@
-export const axiosClient = Symbol("axiosClient");
+export const requestConfig = Symbol("requestConfig");
diff --git a/src/plugins/cache.ts b/src/plugins/cache.ts
deleted file mode 100644
index febbf5e1..00000000
--- a/src/plugins/cache.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-import { setup } from "axios-cache-adapter";
-import { Clockodo } from "../clockodo.js";
-import { axiosClient } from "../lib/symbols.js";
-
-/**
- * @deprecated We're planing to move away from axios to fetch()
- */
-export const cachePlugin =
- (config: { cacheTime: number }) => (clockodo: Clockodo) => {
- if (typeof config.cacheTime !== "number") {
- throw new Error(
- "Clockodo cacheTime expected to be a number, is typeof: " +
- typeof config.cacheTime
- );
- }
- clockodo.api[axiosClient] = setup({
- baseURL: clockodo.api[axiosClient].defaults.baseURL,
- headers: clockodo.api[axiosClient].defaults.headers,
- cache: {
- maxAge: config.cacheTime,
- exclude: { query: false },
- },
- });
- };
diff --git a/tsconfig.json b/tsconfig.json
index 077aac12..60f0bb57 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -2,7 +2,7 @@
"compilerOptions": {
"outDir": "dist",
"target": "es2015",
- "lib": ["es2017"],
+ "lib": ["es2017", "DOM"],
"esModuleInterop": true,
"strict": true,
"moduleResolution": "node",