import { EvershopRequest } from '../../../../types/request.js'; import { EvershopResponse } from '../../../../types/response.js'; /** * POST /api/page-builder/changesets/:id/discard * * Two semantic modes depending on whether the changeset is rollout-attached: * * - **Draft (no rollout_plan).** "Discard" means "throw the edits away." * Per-route: delete ops on that route, clear the cursor entry; if the * changeset has no remaining ops, drop the changeset row too. * Full: delete all ops and the changeset row (rollout_plan rows would * cascade — but there are none in this branch). * * - **Rollout-attached changeset.** "Discard" means "revert to the saved * snapshot." The rollout's `route_cursors` is the floor — the storefront * sees that state. We never delete the changeset or the rollout here; * we only roll back the editor's view. * Per-route: set `changeset.route_cursors[route]` back to * `rollout.route_cursors[route]` and delete ops on that route with * `change_order > restored cursor`. * Full: same, but across every route present in either cursor map. * * Refuses to discard published changesets — those are part of the audit * trail. * * Authorization: only the changeset's `created_by` admin user (or any * admin user — V1 keeps it simple by allowing all admins) can discard. */ declare const _default: (request: EvershopRequest, response: EvershopResponse, _next: (err?: unknown) => void) => Promise; export default _default;