Repository navigation
Conversation
… through post/page params PostCreateParams and PageCreateParams previously had a fixed field set, so a `--json` payload silently dropped `meta`, `acf`, `template`, `featured_media` and custom taxonomy keys such as `blog_category`. Add those fields explicitly plus a `#[serde(flatten)] extra` map so unknown keys reach WordPress verbatim. The Post and Page response structs flatten unknown keys the same way, so `--fields` masks can select anything WordPress returns (e.g. `blog_category`, `acf`, `content.raw`) instead of losing it on deserialisation. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- `request_raw(method, path, params, body)` performs any verb against any route under /wp-json/ with the usual auth, retry and error mapping; the method is validated against an allow-list. - `upload_file(path, file_name, bytes, mime, fields)` builds the multipart form (file part + text fields) on top of the existing `post_multipart`. - `patch()` complements get/post/put/delete. - `mime_from_extension()` guesses MIME types for the WordPress default upload set without pulling in a mime crate. Covered by wiremock integration tests in crates/wpx-api/tests. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
`SiteCredentials::from_env()` reads WPX_USERNAME plus WPX_PASSWORD (or the WPX_APP_PASSWORD alias); `CredentialStore::resolve(site)` prefers those over credentials.toml, following the documented env-over-files precedence. With WPX_URL also set, no site profile or credentials file is needed, which is what CI and agent sandboxes want. build_client and `auth test` now use `resolve`, and their "site not found" errors point at WPX_URL and the [sites.<name>] profile that is required. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…`wpx api`
Post commands can now target any post type exposed in REST. `--type <slug>`
resolves `GET wp/v2/types/{slug}` to `{rest_namespace}/{rest_base}` (core
types resolve without a lookup); `--rest-base` skips the lookup. This also
fixes `post list --type`, which used to send an ignored `?type=` query to
wp/v2/posts and returned the wrong collection. The flag was additionally being
emitted as `--post-type` because clap derives the long name from the field,
not the id; it is now `--type` as documented.
crud.rs gains `list_at / list_all_pages_at / get_at / create_at / update_at /
delete_at` taking an explicit collection path; the original helpers are thin
wrappers over `R::API_PATH`. `resolve_post_type_path` is shared by the CLI
and the fleet dispatcher.
New flags on post/page create and update: `--content-file <path|->`,
`--template`, `--featured-media`; `--context view|edit|embed` on get and list
(edit returns `content.raw`). `--json` payloads now keep unknown keys.
`wpx media upload <file> [--title --alt-text --caption --description --post
--mime-type]` posts a multipart form to wp/v2/media (dry-run aware).
`wpx api <METHOD> <path> [--data | --json] [--query k=v ...]` is the raw REST
escape hatch for routes without a typed command (plugin endpoints, revisions,
abilities). Non-GET requests honour `--dry-run`. Dispatch gains `["api"]` and
`["media", "upload"]` routes, and `["post", *]` routes honour `type` /
`rest_base`, stripping routing-only keys from the body.
Schema entries document the new inputs. Wiremock tests cover routing,
passthrough, dry-run and error mapping.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…d env credentials Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Env-backed boolean flags used clap's strict bool parser, so WPX_NO_PROMPT=1 failed with "invalid value '1'". Use BoolishValueParser for both. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Generic primitives needed to drive real sites (first consumer: the oso.sh content pipeline).
post list|get|create|update|delete|search --type <slug>: resolveswp/v2/types/<slug>→rest_namespace/rest_base, so custom post types work (--rest-baseskips the lookup). Fixes the previous--typethat was emitted as--post-typeand sent an ignored query param.--context view|edit|embedon get/list;--content-file <path|->,--template,--featured-mediaon create/update;--slugfilter on list.--jsonstdin now passes unknown keys through (#[serde(flatten)] extra), plustemplate,featured_media,meta,acf.media upload <file> [--title --alt-text --caption --description --post --mime-type]via multipart.wpx api <METHOD> <path> [--data | --json] [--query k=v]...raw REST escape hatch (honours--dry-run).WPX_USERNAME+WPX_PASSWORD/WPX_APP_PASSWORD(withWPX_URL, no profile needed) for CI.NO_COLOR/WPX_NO_PROMPTaccept1/0/yes/no.crud.rsgains*_athelpers taking an explicit API path; docs and schema entries updated.cargo fmt --check,cargo clippy --workspace -- -D warnings,cargo test --workspace(118 passed). Smoke-tested against oso.sh.🤖 Generated with Claude Code