docs(tailordb): document hook _newValue/_oldValue and _newData/_oldData#144
Closed
toiroakr wants to merge 1 commit into
Closed
docs(tailordb): document hook _newValue/_oldValue and _newData/_oldData#144toiroakr wants to merge 1 commit into
toiroakr wants to merge 1 commit into
Conversation
Document the new hook variables exposing this request's raw input and the pre-operation value. Uses the raw expression-string forms only; TS SDK callback support is a prerequisite follow-up. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
Author
|
Not needed for now: hook reference docs are synced from the SDK repo (docs/sdk/ via sdk-docs-sync). The new variables should be documented in tailor-platform/sdk alongside the HookFn change, which then syncs over. Closing; will fold into the SDK 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
Documents the new TailorDB hook variables that expose this request's raw input and the pre-operation value, so update hooks can tell what the user actually sent apart from the existing record.
_newValue/_oldValue— this field's raw input / previous value (JS + CEL)_newData.{field}/_oldData.{field}— sibling fields of the request input / previous record (CEL only)_value/_dataare unchanged (still the merged state). Backed by platform-core-services#12177.This is intentionally a draft. Right now the new variables are only usable via the raw expression string forms (Terraform
.tf, CUE, CEL*_expr), which is what the examples here use, because those map directly to the backend script runtime.The TypeScript SDK callback form is not yet supported:
@tailor-platform/sdk'sHookFncurrently only destructures{ value, data, user }(packages/sdk/src/configure/services/tailordb/types.ts). Before this page can show.tsexamples like({ newValue, oldValue }) => ..., the SDK needs a matching change (extendHookFn+ the hook→script compiler). Tracking that as a prerequisite follow-up.Open items before un-drafting
tailor-platform/sdk: exposenewValue/oldValue/newData/oldDatain the hook callback context, then add.tsexamples to mirror the.tfones here_input/_newData/_oldData/_oldDataon type validate), which are currently undocumented on this page🤖 Generated with Claude Code