camunda / camunda/api-test-generator
feat: js-sdk emitter — align generated suites to the real @camunda8/orchestration-cluster-api SDK (follow-up to #348)
@johnOC03 is already working on this.
Since Jun 2, 2026.
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 3
- Avg merge
- 13h 41m
- Merged PRs (30d)
- 23
Description
Summary
The js-sdk emitter introduced in #348 (intended to close #131) renders real
request bodies and requestPlan steps, but it is written against a
@camunda8/sdk API surface that does not match the real published SDK
(@camunda8/orchestration-cluster-api, the package built by
camunda/orchestration-cluster-api-js — see issue #131's title). As a result
the emitted suite would not compile/run against the real package: it is the
same class of executable-correctness gap as the Python emitter (#354), just
less obvious because the JS emitter does lower real request bodies.
This follow-up tracks aligning the JS emitter to the real SDK so
codegen:js-sdk:all produces runnable suites.
Mismatches (verified against camunda/orchestration-cluster-api-js README + its examples/operation-map.json)
All in materializer/src/js-sdk/emitter.ts (and materialize-support.ts):
- Package + factory name. Emitter imports
createApiClient/ApiClient/
RestClientErrorfrom@camunda8/sdk(emitter.ts:~94-95,
materialize-support.ts:~36/51/181/187). The real package is
@camunda8/orchestration-cluster-api; the factory iscreateCamundaClient
(default + named export). There is noApiClienttype (use
ReturnType<typeof createCamundaClient>) and noRestClientErrorexport. - Success has no HTTP wrapper. Emitter asserts
expect(response.status).toBe(200)
(emitter.ts:~259) and extracts viaresponse.data<accessor>(~264). The
real SDK methods return the deserialized body directly — there is no
.statusor.dataon success. Status assertions and data extraction must be
reworked to operate on the returned body. - Error shape. Emitter does
error as RestClientErrorthen reads.status
(emitter.ts:~250). The SDK throws plainErrorobjects that carry.status
and are detectable viaisSdkError(e); there is noRestClientErrortype to
cast to. - Op-map shape mismatch (dead weight).
OperationMapJsonSource.fromJson
(sdk-mapping.ts:~14/28) expectsRecord<string,string>, but the real
examples/operation-map.jsonisRecord<string, {file,region,label}[]>.
lookup()therefore always returnsundefinedand the emitter falls back to
toCamelCase(opId). That fallback is coincidentally correct (method name ==
operationId in camelCase), so calls resolve — but the op-map plumbing is
effectively unused and should either be removed or re-typed to the real shape.
Definition of done
codegen:js-sdk:allemits suites that compile and run against
@camunda8/orchestration-cluster-api(factorycreateCamundaClient,
body-direct returns,isSdkError-based error handling).response.status/response.dataassumptions removed; status/extract logic
operates on the returned body.- Op-map source either removed or re-typed to the real array-of-objects shape
(no silent always-undefined fallback masquerading as a lookup). tests/codegen/js-sdk-emitter.test.tsupdated to assert the real SDK call
shape; JS L3 invariants inconfigs/camunda-oca/regression-invariants.test.ts
assert real emitted content (not just file presence).
Context
- Original feature issue: #131.
- Sibling follow-up for Python: #354 (same class of gap).
- C# emitter (
materializer/src/csharp-sdk/emitter.ts) is the closest
executable reference in-repo. - Review thread: https://github.com/camunda/api-test-generator/pull/348
(comment onjs-sdk/emitter.tsre: aligning to the real package).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.