Skip to content

feat(turbosign): support conditional (IF/THEN) fields - #31

Merged
amitsharma-turbodocx merged 1 commit into
mainfrom
feature/turbosign-conditional-fields
Aug 19, 2026
Merged

amitsharma-turbodocx merged 1 commit into
mainfrom
feature/turbosign-conditional-fields

Conversation

@amitsharma-turbodocx

Copy link
Copy Markdown
Contributor

Summary

Adds TurboSign conditional (IF/THEN) fields to the node. A signature field can carry an optional metadata object so a checkbox controls dependent fields:

  • On the checkbox: metadata.fieldKey.
  • On a dependent field: metadata.conditional = { controllingFieldKey, operator ("is_checked" | "is_not_checked"), action ("show" | "unlock") }.

The fields parameter is a raw-JSON passthrough, so metadata reaches the API unchanged — no serialization change.

What changed

  • README: a "Conditional (IF/THEN) Fields" section with property tables, show/unlock semantics, and a worked example workflow.
  • fields parameter description/hint mention metadata/conditional.
  • The handler validates each rule's shape (operator, action, non-empty controllingFieldKey) and fails fast with a clear NodeOperationError before sending — matching the API's 400. A dangling controllingFieldKey is allowed (the API fails open).
  • New test suite: passthrough of metadata.conditional into the multipart body + rejection of malformed rules.

Kept the raw-JSON fields convention (no structured fixedCollection UI), per the node's CONTRACT.

Notes

Part of a coordinated conditional-fields rollout across the TurboDocx public repos (SDK, Docs, quickstart) — sibling PRs linked in a follow-up comment.

A signature field can carry an optional `metadata` object turning a checkbox into
a controller for dependent fields: `metadata.fieldKey` on the checkbox, and
`metadata.conditional` = { controllingFieldKey, operator ("is_checked" |
"is_not_checked"), action ("show" | "unlock") } on a dependent field. The fields
JSON is a passthrough, so metadata rides along unchanged; the node validates each
rule's shape and fails fast with a clear error before sending, matching the API's
400. Documented in the README with a worked example; adds a test suite.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@amitsharma-turbodocx

Copy link
Copy Markdown
Contributor Author

Coordinated conditional-fields rollout — sibling PRs: TurboDocx/SDK#71 · TurboDocx/Docs#150 · TurboDocx/quickstart#24

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.

1 participant