// `content.unpublish` — take a published row down: delete it from // `_published` and flip the draft back to `status: 'draft'` (atomic per // row). A row with no published copy in the caller's scope → `{ ok: false }`. import { defineMutation } from '@voltro/protocol' import { Schema } from 'effect' export const unpublishContent = defineMutation({ name: 'content.unpublish', // Editors only. Taking a page DOWN is as much a live-site change as putting // one up — an unguarded unpublish is a denial-of-service against your own // content — so it carries the same `content:write`, satisfied by a signed-in // session and refused to an anonymous caller. guards: [{ scope: 'content:write' }], input: Schema.Struct({ type: Schema.NonEmptyString, id: Schema.NonEmptyString }), output: Schema.Struct({ ok: Schema.Boolean }), })