Skip to content

feat(webhooks): pick-not-type sys_webhook form (method / triggers / object)#2880

Merged
os-zhuang merged 1 commit into
mainfrom
claude/platform-sharing-rules-b29165
Jul 13, 2026
Merged

feat(webhooks): pick-not-type sys_webhook form (method / triggers / object)#2880
os-zhuang merged 1 commit into
mainfrom
claude/platform-sharing-rules-b29165

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

What & why

Follow-up to the sharing-rule "pick, don't type" work (#2878). Auditing the platform's other admin-authored (managedBy: 'config') forms surfaced sys_webhook as the standout: its create/edit form made admins hand-enter machine data in three fields. This turns them into proper controls.

Field Before After
method free-text HTTP method select — GET / POST / PUT / PATCH / DELETE
triggers hand-typed comma string create,update,delete multi-select — create / update / delete / undelete / api
object_name free-text machine name object-ref object picker (same widget as sys_sharing_rule)

Backward compatibility (no migration)

  • triggers is now stored as an array, but AutoEnqueuer.parseRow accepts array, JSON-encoded-array-string, and the legacy comma-separated forms — existing subscriptions keep firing. Tests added for the array and JSON-string shapes.
  • method select option values are lowercased by Field.select; the auto-enqueuer now upper-cases the resolved method before delivery, so legacy 'POST' rows and the new lowercase values both normalise to a canonical HTTP method.
  • object_name stores the object name (unchanged); object-ref degrades to a text input where the widget isn't loaded.

Scope

Framework-only — the object-ref widget already shipped in objectui (#2421). This is part of the same claude/platform-sharing-rules-b29165 line; the prior PR merged, so this branch was restarted from main.

Deferred (flagged for a separate look): sys_position.permissions (a loose "JSON array of permission strings" whose reader is unclear — could be legacy; needs its own investigation before picking a widget). sys_webhook.definition_json (full webhook config) would benefit from a structured editor — larger, separate.

Verification

  • @objectstack/plugin-webhooks build ✅ · tests 12/12 ✅ (incl. 2 new trigger-shape tests)

🤖 Generated with Claude Code


Generated by Claude Code

…bject)

Extend the sharing-rule "pick, don't type" pass to the webhook form — the three
fields where an admin had to hand-enter machine data become proper controls:

- method: free text → select (GET/POST/PUT/PATCH/DELETE). Values are lowercased
  by Field.select; auto-enqueuer upper-cases the resolved method before delivery
  so legacy 'POST' rows and the new lowercase values both normalise.
- triggers: hand-typed comma string → multi-select (create/update/delete/
  undelete/api), stored as an array. parseRow now accepts array / JSON-string /
  legacy comma-string, so existing subscriptions keep firing (no migration).
- object_name: free text → the object-ref picker (same widget as sys_sharing_rule;
  degrades to a text input when the widget isn't loaded).

Tests added for the array and JSON-string trigger shapes. Framework-only — the
object-ref widget already shipped in objectui.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013wGu7aa1YXhHseojW9CBRf
@vercel

vercel Bot commented Jul 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Building Building Preview, Comment Jul 13, 2026 9:34am

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation tests tooling size/m labels Jul 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/plugin-webhooks.

3 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:

  • content/docs/automation/webhooks.mdx (via packages/plugins/plugin-webhooks)
  • content/docs/plugins/packages.mdx (via @objectstack/plugin-webhooks)
  • content/docs/releases/implementation-status.mdx (via @objectstack/plugin-webhooks)

Advisory only. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs origin/main → pass the list as args.docs.

@os-zhuang os-zhuang marked this pull request as ready for review July 13, 2026 09:41
@os-zhuang os-zhuang merged commit f344ee1 into main Jul 13, 2026
15 of 16 checks passed
@os-zhuang os-zhuang deleted the claude/platform-sharing-rules-b29165 branch July 13, 2026 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants