saintedlama / toggl-client

Client for the Toggl API built for async and await support
ISC License
14 stars 4 forks source link

Update reports module for remaining v9 API changes #41

Open beauraines opened 1 year ago

beauraines commented 1 year ago

In PR #28, only the high priority methods for Obsidian integration with toggl and toggl-node-cli were updated. The remaining methods need to be updated to use the v9 endpoints and new requirements in the specified module.

Observations from prior work.

  1. The information is the response is no longer nested in a data property. The use of the mapData() function is probably not needed.
  2. In some cases, the API calls now require certain parameters in the request. The methods in this function ensure that the calling client passed the newly required attributes.
  3. In some cases, where an id was passed before, the entire time entry needs to be passed.

Toggl API Documentation

Acceptance Criteria

  1. All existing client methods work with the new v9 API.
  2. Smoke tests created for all list-type endpoints and should pass locally. Call this out specifically in your PR in case the tests do not run automatically.
  3. Doc blocks added to all exported methods
  4. README reference section updated for that method

Issue created via script

beauraines commented 3 months ago

weekly and weeklyAll are the same. The latter should be deprecated. details and summary seem to work, but they're the paginated endpoints. the detailsAll and summaryAll are the ones that claim to pull paginated data, but they don't work because the pagination information is in the header, as opposed to the payload.

I think that the the detailsAll and summaryAll should be removed.