fix: Address Scott's review: restore version option, JSDoc, and shared test BASE#4
Merged
Merged
Conversation
PR #2 hardcoded `v1` everywhere. Per Scott's review, the right move was to change the default — not drop the option. Restores `version?: ApiVersion` on `ClientConfig` / `CommsApiOptions`, defaulting to `'v1'`. The `ApiVersion` union currently lists only `'v1'`; new versions just need a one-line entry in `API_VERSIONS`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
PR #2 stripped `@param` / `@returns` / `@example` blocks as collateral damage while collapsing the batch overloads. Per Scott's review, those JSDocs feed the SDK documentation site. Restored from the bootstrap SDK and re-anchored onto the current single-signature methods, with all batch references dropped. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Each MSW test was redeclaring `const BASE = 'https://comms.todoist.com/api/v1'`. Moved to `TEST_API_BASE_URL` in `testUtils/test-defaults.ts`, imported as `BASE` at the call sites to keep the tests readable. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
doistbot
reviewed
May 21, 2026
Member
doistbot
left a comment
There was a problem hiding this comment.
This PR thoughtfully restores the API version configuration, revives important JSDoc comments for the SDK site, and centralizes test URL defaults. These updates do a great job improving the generated documentation and standardizing configuration across the client. There are just a few remaining details to resolve regarding mismatches between the restored JSDocs and the current TypeScript types, along with some logic duplication in the base URL construction that could be streamlined and covered by an additional request-level test.
scottlovegrove
approved these changes
May 21, 2026
…lper - Sync client JSDoc with current request types (drop sendAsIntegration / recipients from create/update comment + thread docs, fix updateComment content required, fix UpdateUserArgs example name vs fullName, workspaceId required on getThreads and group add/remove ops, soften updatePassword.currentPassword wording). - Add `@param args` root descriptions to GroupsClient.getGroup / deleteGroup so JSDoc tooling parses the destructured args correctly. - Route BaseClient.getBaseUri through getCommsBaseUri so the default and custom-base paths share one URL builder; teach the helper to preserve the path on custom domains (e.g. `https://proxy/comms` → `.../comms/api/v1/`). - Derive TEST_API_BASE_URL from getCommsBaseUri() so the default host / version live in one place. - Add a request-level test that calls the SDK with a custom baseUrl and asserts the final request URL.
Per Scott's review on #4: the shared TEST_API_BASE_URL was only used in two test files. Replace the remaining hardcoded `apiUrl('api/v1/...')` calls in `add-comment-helper.test.ts` and `custom-fetch-simple.test.ts` so every API-side test goes through the same constant. Deprecated-param cleanup is intentionally deferred to a follow-up PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Follow-up to Scott's review on #2. Two themes: the
apiVersionconfig should have stayed (just change the default), and a lot of JSDoc was stripped as collateral damage while removing batch overloads — those docs feed the SDK documentation site.What was changed
ClientConfig/CommsApiOptionsacceptversion?: ApiVersionagain, default'v1'.ApiVersionis a one-entry union for now; adding a future version is a one-liner inAPI_VERSIONS.@param/@returns/@exampleJSDoc on every client method (~1.2k lines). Single-signature methods stay; no batch references reintroduced.const BASE = 'https://comms.todoist.com/api/v1'intoTEST_API_BASE_URLintestUtils/test-defaults.ts.Verified:
type-check,oxlint,oxfmt, full Vitest (114/114).Refs