Fix weclapp connector: migrate to API v2 (/party replaces /customer) - #143
Merged
Merged
Conversation
The adapter was pinned to /webapp/api/v1, which weclapp marks as legacy
and discourages for new integrations. More importantly, /customer was
removed in v2 and replaced by /party (customers and suppliers unified),
so weclapp_list_customers / weclapp_get_customer were broken on any v2
tenant — the most common cause of users reporting the connector "doesn't
work".
Changes to weclapp.json:
- baseUrl /webapp/api/v1 -> /webapp/api/v2
- /customer, /customer/id/{customerId} -> /party, /party/id/{partyId}
- Add optional properties / filter / sort query params on list tools
(matches v2 spec: properties_qs, filter_qs, sort_qs)
- Fix pageSize description (default 100, max 1000 per spec)
Add weclapp.live.spec.ts with two layers:
- Static (always runs): asserts baseUrl is on v2, auth header is
AuthenticationToken, no path references /customer, and the v2 paths
/party, /salesOrder, /salesInvoice, /article are all present.
- Live (RUN_WECLAPP_LIVE=1, skipped in CI): hits weclapp's edge with a
bogus tenant, asserts 404 with `server: weclapp` (proves baseUrl
resolves to weclapp infrastructure), and asserts the AuthenticationToken
header is actually injected by RestEngine.
End-to-end validation against a real tenant still requires a weclapp
account (no public sandbox exists) and is out of scope for this change.
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
/customerwas removed in v2 and replaced by/party, which is the most likely cause of users reporting the connector "doesn't work"properties/filter/sortparams on list tools so AI agents can scope queries (e.g.filter=customerNumber-notnull=truefor customers only)weclapp.live.spec.tswith a static block (always runs in CI) that prevents regressions back to v1 //customer, plus a live-edge block (gated byRUN_WECLAPP_LIVE=1) that proves the URL resolves to weclapp infrastructure and thatAuthenticationTokenis actually injected byRestEngineWhy
Verified against the official OpenAPI v2 spec at https://www.weclapp.com/api/openapi_v2.yaml:
baseUrlishttps://<TENANT>.weclapp.com/webapp/api/v2//customerdoes not exist in v2 — replaced by/party(customers and suppliers unified, distinguishable viacustomerNumber-notnull/supplierNumber-notnull/partyType-eq)AuthenticationToken(was already correct)Limitations
/party//articleresponses requires a real tenant + token. The live test only proves routing + auth pipeline reach weclapp's edge.Test plan
npm test --workspace=packages/backend -- src/adapters/de/weclapp.live.spec.ts— 4 static tests passRUN_WECLAPP_LIVE=1 npm test ...— 6/6 pass (404 fromserver: weclapp,AuthenticationTokenheader confirmed injected)