feat(wiki): add create, update and delete actions #15
No reviewers
Labels
No labels
area/dsh
area/forgejo
experiment
priority/later
priority/next
priority/now
type/bug
type/task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
dsh-plugins/dsh-gitea!15
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/10-wiki-write"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
gitea_wikiwas read-only:listandgetonly. This adds the three write actions Forgejo already exposes:createPOST /wiki/newtitle; body sent ascontent_base64updatePATCH /wiki/page/{pageName}content; replaces the full pagedeleteDELETE /wiki/page/{pageName}confirm: truelist/getare unchanged.Also handles the naming quirk from the issue: Forgejo may derive the page slug from the title (an API-created
Probe-PagebecameProbe-Page.-).listnow printsTitle (pageName: <slug>), and the tool description says to address pages by that slug. Without this, a created page could not be fetched/edited by its display title.Verification
content_base64, unicode round-trip), PATCH segment encoding, DELETE, and 401/403 failures; handler tests for missingtitle/content,confirmon delete, and API failure passthrough.test/wiki.test.mjsnow covers all three.npm test60/60, leak scan clean,node --checkclean.ml-lab/tardits(empty wiki), then cleaned up:createProbe-Page→ created + URL;list→Probe-Page (pageName: Probe-Page.-);get pageName: Probe-Page.-→ metadata + last commit;update→ new commit83a1d1d8;delete confirm:true→ deleted;list→No wiki pages.Acceptance (from #10)
createon an empty wiki succeeds and the page is readable viaget/API.updatechanges content;deleteremoves the page (withconfirm: true).list/getbehaviour unchanged.Closes #10.
Forgejo exposes POST /wiki/new and PATCH|DELETE /wiki/page/{pageName}; the tool only had list/get. Encode the body as content_base64, require confirm for delete, surface the canonical pageName slug in list output, and document the API's slug quirk.