Skip to content

[TSX SDK] Port transformWithMapping to @common-grants/sdk; add handler-registry API #833

Closed

Description

@laurabelinfante

Summary

Port website/src/lib/transformation.ts into lib/ts-sdk/src/extensions/transformation.ts, update the website to import from @common-grants/sdk, and expose buildTransforms() with a per-call handlers? argument as the public API in both SDKs, matching ADR-0022 Decision #8 (handlers registered per call, not globally). The Python equivalent (common_grants_sdk/utils/transformation.py) is already in the SDK but needs its public API formalized.

Acceptance criteria

  • @common-grants/sdk exports buildTransforms(toCommonMapping, fromCommonMapping, handlers?) returning { toCommon, fromCommon }
  • common-grants-sdk exports build_transforms(to_common_mapping, from_common_mapping, handlers=None)
  • Default handler set (field, switch) is exported and documented; Handler type is exported for custom-handler typing
  • Name collisions between user-supplied handlers and the default set raise at buildTransforms() load time (not silently shadowed)
  • Per-call handler scoping documented with an example

Related

Metadata

Metadata

Assignees

Labels

sdkIssue or PR related to our SDKsts-sdkRelated to TypeScript SDKtypescriptIssue or PR related to TypeScript tooling

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions