Skip to content

Releases: tomdyson/wagapi

v0.8.0

Choose a tag to compare

@tomdyson tomdyson released this 09 Apr 11:57

What's new

Markdown output by default

  • pages get now returns rich text fields as Markdown instead of HTML
  • Use --html flag to get HTML output when needed
  • Powered by wagtail-write-api 0.8.0's new ?rich_text_format=markdown parameter

Requires wagtail-write-api >= 0.8.0.

v0.7.2

Choose a tag to compare

@tomdyson tomdyson released this 09 Apr 09:12

Send X-Hints: wagapi header to opt in to API hints.

v0.7.1

Choose a tag to compare

@tomdyson tomdyson released this 08 Apr 10:34

Simplified CLI: --field is all you need

Removed --raw and --streamfield flags. The --field flag now handles everything:

  • StreamField: auto-detected via schema, markdown converted to blocks
  • RichTextField: auto-detected via schema, markdown sent for server-side conversion
  • JSON values: arrays ([...]) and objects ({...}) auto-parsed
  • Plain strings: sent as-is

For full StreamField JSON control, pass a JSON array directly:

wagapi pages create testapp.BlogPage --parent /blog/ \
  --title "Test" \
  --field 'body:[{"type":"paragraph","value":"<p>Hello</p>"}]'

v0.7.0

Choose a tag to compare

@tomdyson tomdyson released this 08 Apr 10:04

Breaking: Remove --body flag from create and update commands.

New features:

  • --field now auto-detects StreamField and RichTextField via schema — just pass markdown and it's converted automatically
  • --streamfield FIELD:MARKDOWN for explicit StreamField conversion without a schema fetch
  • --type on update enables auto-detection with one schema fetch (no extra page GET)

Migration: Replace --body "markdown" with --field "body:markdown". The CLI now handles the conversion automatically based on the page type schema.

v0.6.0

Choose a tag to compare

@tomdyson tomdyson released this 07 Apr 16:28

Snippet CRUD commands

Add CLI support for managing Wagtail snippets via the new wagtail-write-api snippet endpoints.

  • New command group: wagapi snippets list|get|create|update|delete
  • Schema flags: wagapi schema --snippets and wagapi schema --all for snippet type discovery
  • Client methods: list_snippets, get_snippet, create_snippet, update_snippet, delete_snippet
  • Snippet-aware example commands in schema detail output

This release aligns version numbering with wagtail-write-api — both projects now share minor versions to indicate API compatibility.

v0.5.1

Choose a tag to compare

@tomdyson tomdyson released this 07 Apr 15:37

Bug fixes

  • Markdown lists no longer silently dropped: bullet lists (- item) and ordered lists (1. item) in --body markdown are now correctly converted to HTML <ul>/<ol> blocks when targeting StreamField page types. Previously they were silently discarded.

v0.5.0

Choose a tag to compare

@tomdyson tomdyson released this 07 Apr 14:14

Block-level StreamField editing

New flags on wagapi pages update to add blocks to an existing StreamField body without replacing the whole thing:

  • --append-block JSON — append a block to the end of the body (repeatable)
  • --insert-block INDEX JSON — insert a block at a specific position (repeatable)

The CLI fetches the current body, splices in the new block(s), and sends the result.

# Upload an image and add it to a post
wagapi images upload photo.jpg --title "Photo"
wagapi pages update 42 --append-block '{"type":"image","value":4}'

# Insert at a specific position
wagapi pages update 42 --insert-block 1 '{"type":"paragraph","value":"<p>New paragraph</p>"}'

UUIDs are auto-generated for blocks that don't include an id. Cannot be combined with --body.

v0.4.0

Choose a tag to compare

@tomdyson tomdyson released this 07 Apr 13:08

What's new

  • pages find — search pages by title or content for quick ID lookup (wagapi pages find "iris murdoch")
  • pages get by path — accept URL paths in addition to numeric IDs (wagapi pages get /blog/my-post/)
  • images upload — upload images via CLI (wagapi images upload photo.png --title "My Photo")
  • Block type remapping — auto-remap paragraph→text when the target StreamField requires it; warn when no compatible block type exists (fixes silent data loss on non-standard StreamField configurations)
  • Empty fields visible — empty StreamField/RichText fields now show (empty) instead of being silently hidden
  • Schema footnote — schema detail output notes that required fields are enforced on publish, not draft creation
  • Richer images list — dimensions shown alongside title

v0.3.0

Choose a tag to compare

@tomdyson tomdyson released this 07 Apr 12:30

What's new

  • URL paths in output — pages list and pages get now show the URL path (e.g. /blog/my-post/) in human-readable output
  • Body content previews — pages get shows actual text content instead of [heading, paragraph] (2 blocks)
  • Field type labels — schema output shows StreamField and RichText instead of generic array/string
  • --version flag — wagapi --version now works
  • Exit 0 for bare wagapi — shows help instead of a usage error
  • README fixes — corrected --parent /home/ to --parent /, clarified example app path

Tests

  • Added 16 new tests for formatters (_streamfield_preview, _richtext_preview, url_path display, field type annotations)

Requires wagtail-write-api >= 0.3.0 for url_path and richtext_fields support.

v0.2.3

Choose a tag to compare

@tomdyson tomdyson released this 07 Apr 11:44

Bug fix

  • Fix body format for RichTextField pages: --body now checks the page type schema to determine the field type. StreamField fields receive blocks as before; RichTextField fields receive a {"format": "markdown", "content": "..."} dict for server-side conversion, instead of blocks that were stored as a corrupted string.

Docs

  • Update --parent and --descendant-of docs: list filters accept URL paths (e.g. /blog/), not just IDs
  • Document auto-detection of body field type