feat!: bump @gewis/planka-client to 3.0.1 (Planka v2 API)#85
Merged
Conversation
@gewis/planka-client@3.x targets the Planka v2 OpenAPI spec and introduces native API key support, so this commit replaces the hand-rolled bearer-token-as-API-key pattern with the official `X-Api-Key` header via `withApiKey()`. Type renames (openapi-ts now generates `*Data` instead of `*Request`): - CreateCardRequest → CreateCardData - UpdateCardRequest → UpdateCardData - GetBoardRequest → GetBoardData Other v3 surface changes that needed handling: - Base URL must include `/api`. `ensureApiSuffix()` appends it if PLANKA_URL doesn't already end in `/api`, so existing configs keep working. - `RequestResult.response` is now `Response | undefined` (network errors may have no response object) — guarded all `.response.status` reads with `?? 0`. - `List.name` is now `string | null` — guarded `.toLowerCase()`. Drops `@hey-api/client-fetch` as a direct dep — the `Options` type is re-exported from `@gewis/planka-client`, and the `client` singleton no longer needs a separate `Client` type alias (replaced with a simple `initialized` flag). README updated: PLANKA_API_KEY no longer requires manual DB token insertion, and PLANKA_URL behaviour around `/api` is documented.
There was a problem hiding this comment.
Pull request overview
Updates the Planka integration to use the Planka v2 OpenAPI client and switch authentication from a bearer-style token to native API keys (X-Api-Key), aligning runtime behavior and documentation with the new client and spec.
Changes:
- Bumped
@gewis/planka-clientto3.0.1and removed the direct@hey-api/client-fetchdependency. - Updated Planka client initialization to use
withApiKey()and normalizedPLANKA_URLhandling via an automatic/apisuffix. - Adjusted code for Planka client v3 type/shape changes and nullable/optional response fields; updated README guidance for API keys and base URL.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
yarn.lock |
Locks @gewis/planka-client@3.0.1 and updates transitive @hey-api/client-fetch resolution. |
package.json |
Pins @gewis/planka-client to 3.0.1 and drops direct @hey-api/client-fetch dependency. |
src/planka.ts |
Migrates to API-key auth (withApiKey), appends /api to base URL, and adapts to updated generated types/nullability. |
README.md |
Updates operator documentation for Planka v2 API keys and clarifies PLANKA_URL behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const plankaUrl = this.settings.plankaUrl || DEFAULT_PLANKA_URL; | ||
| const plankaApiKey = this.settings.plankaApiKey || process.env['PLANKA_API_KEY']; | ||
| if (!plankaApiKey) { | ||
| throw new Error('PLANKA_API_KEY is required (mint one via createUserApiKey).'); |
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.
Summary
Bumps
@gewis/planka-clientfrom^2.0.1→3.0.1(Planka v2 OpenAPI spec). Switches the auth flow to native API keys (X-Api-Key) via the newwithApiKey()helper, and absorbs the v3 type/shape changes.Breaking-ish for operators
PLANKA_API_KEYis now an actual Planka v2 API key (mint withPOST /api/users/{id}/api-key), not a long-lived session token shoehorned into the DB.PLANKA_URLworks with or without/api—ensureApiSuffix()appends it if missing, so existing values keep working.Code changes
Authorization: Bearer ${apiKey}header withwithApiKey(apiKey)(sendsX-Api-Key).*Datainstead of*Request):CreateCardRequest→CreateCardDataUpdateCardRequest→UpdateCardDataGetBoardRequest→GetBoardDataRequestResult.response(nowResponse | undefined) reads with?? 0.List.name(nowstring | null) with optional chaining.@hey-api/client-fetchdep —Optionsis re-exported from@gewis/planka-client, and theClienttype alias is replaced with a simpleinitializedboolean.Test plan
🤖 Generated with Claude Code