Skip to content

feat!: bump @gewis/planka-client to 3.0.1 (Planka v2 API)#85

Merged
JustSamuel merged 1 commit into
mainfrom
feat/planka-client-v3
May 7, 2026
Merged

feat!: bump @gewis/planka-client to 3.0.1 (Planka v2 API)#85
JustSamuel merged 1 commit into
mainfrom
feat/planka-client-v3

Conversation

@JustSamuel

Copy link
Copy Markdown
Collaborator

Summary

Bumps @gewis/planka-client from ^2.0.13.0.1 (Planka v2 OpenAPI spec). Switches the auth flow to native API keys (X-Api-Key) via the new withApiKey() helper, and absorbs the v3 type/shape changes.

Breaking-ish for operators

  • PLANKA_API_KEY is now an actual Planka v2 API key (mint with POST /api/users/{id}/api-key), not a long-lived session token shoehorned into the DB.
  • PLANKA_URL works with or without /apiensureApiSuffix() appends it if missing, so existing values keep working.

Code changes

  • Replaced Authorization: Bearer ${apiKey} header with withApiKey(apiKey) (sends X-Api-Key).
  • Type renames (openapi-ts now generates *Data instead of *Request):
    • CreateCardRequestCreateCardData
    • UpdateCardRequestUpdateCardData
    • GetBoardRequestGetBoardData
  • Guarded RequestResult.response (now Response | undefined) reads with ?? 0.
  • Guarded List.name (now string | null) with optional chaining.
  • Dropped direct @hey-api/client-fetch dep — Options is re-exported from @gewis/planka-client, and the Client type alias is replaced with a simple initialized boolean.
  • Replaced outdated README note about manual DB token insertion.

Test plan

  • `yarn build` passes (`tsc` clean)
  • `yarn lint` clean
  • `yarn format` clean
  • Manual smoke: run against a live Planka v2 instance with a freshly minted API key

🤖 Generated with Claude Code

@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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-client to 3.0.1 and removed the direct @hey-api/client-fetch dependency.
  • Updated Planka client initialization to use withApiKey() and normalized PLANKA_URL handling via an automatic /api suffix.
  • 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.

Comment thread src/planka.ts
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).');
@JustSamuel JustSamuel merged commit 5a8b4da into main May 7, 2026
7 checks passed
@JustSamuel JustSamuel mentioned this pull request May 7, 2026
@JustSamuel JustSamuel deleted the feat/planka-client-v3 branch May 7, 2026 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants