Conversation
c0da499 to
21b0a37
Compare
Add commands to manage webhooks in a Prismic repository: create, list, view, remove, test, enable, disable, status, add-header, remove-header, and set-triggers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
21b0a37 to
e29c315
Compare
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Align webhook files with main's module structure: - auth: ./lib/auth → ../auth - config: ./lib/config (safeGetRepositoryFromConfig) → ../project (safeGetRepositoryName) - env: ../lib/env → ../env - valibot → zod/mini Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Each trigger field was incorrectly reading from webhookConfig.documentsUnpublished instead of the corresponding property. The last line also used a duplicate "documentsPublished" key instead of "tagsDeleted". Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…rectly Remove the TRIGGER_DISPLAY mapping and reverse-lookup logic. Trigger names now use the API's camelCase format (e.g. documentsPublished) everywhere, eliminating unnecessary format conversion. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove test, status, add-header, and remove-header webhook subcommands that are not needed for the initial release. Tighten host parameter types from `string | undefined` to `string` in wroom client functions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| await writeFile( | ||
| new URL(".prismic", home), | ||
| JSON.stringify({ token, host: DEFUALT_PRISMIC_HOST }), | ||
| ); |
There was a problem hiding this comment.
Login fixture ignores PRISMIC_HOST environment variable
Medium Severity
The login fixture now hardcodes DEFUALT_PRISMIC_HOST ("prismic.io") into the .prismic auth file, instead of using the process.env.PRISMIC_HOST value. Previously the module-level PRISMIC_HOST variable respected the environment variable. The new host fixture correctly reads from the env, but login doesn't use it — so when PRISMIC_HOST is set to a custom value, the CLI under test reads the wrong host from its auth file, while test helpers (like getWebhooks in test/prismic.ts) use the correct one.


Resolves: #52
Description
Add webhook management commands to the CLI. This introduces the
prismic webhookcommand with subcommands for creating, listing, viewing, removing, enabling, and disabling webhooks, as well as managing triggers.The following commands are included:
prismic webhook listprismic webhook viewprismic webhook createprismic webhook removeprismic webhook set-triggersprismic webhook enableprismic webhook disableChecklist
Preview
How to QA 1
Build and run
./dist/index.mjs webhookto see the help output.Note
Medium Risk
Adds new CLI subcommands that mutate repository webhook configuration via authenticated requests to Prismic settings endpoints, which could impact users’ webhook setups if request formatting/trigger selection is wrong. Changes are mostly additive and covered by new e2e tests, but touch live remote state (create/update/delete).
Overview
Adds a new
prismic webhooktop-level command with subcommands to list/view/create/remove webhooks, enable/disable them, and update trigger events (with trigger validation and helpful error handling).Introduces a
wroomclient (getWebhooks,createWebhook,updateWebhook,deleteWebhook) that talks to Prismic’s webhooks settings endpoints using the existingrequesthelper and zod schemas.Updates tests to cover the new webhook workflows end-to-end and tweaks help-text assertions and test fixtures to pass through a configurable
PRISMIC_HOST.Written by Cursor Bugbot for commit 91f12f8. This will update automatically on new commits. Configure here.
Footnotes
Please use these labels when submitting a review:
⚠️ #issue: Strongly suggest a change.
❓ #ask: Ask a question.
💡 #idea: Suggest an idea.
🎉 #nice: Share a compliment. ↩