These four resources are the only ones with the SDK's entity_action_methods! route. Adds: - `action <id> <action>` - mark_sent, mark_paid, archive, restore, clone_to_invoice, clone_to_quote, auto_bill, delete (routed), returning the updated record. - `download <id>...` - the rendered PDF, to stdout or `--out <path>`; more than one id streams a single merged PDF (Invoice Ninja's bulk download action). New EntityResourceArgs/EntityAction in cli.rs rather than extending the existing ResourceArgs/Action: Rust enums don't compose, and every resource's `run` match on Action needs to stay exhaustive without a catch-all arm for variants it doesn't support. Found and fixed along the way: the Download variant's --output <path> field collided by name with the global --output table|json flag, causing clap to panic at runtime trying to downcast the wrong type. Renamed to --out. Extended tests/nixos-test.nix to exercise action/download for real against the VM. That caught a test-ordering bug of its own - asserting mark_sent on an invoice *after* paying it off, which correctly doesn't revert status_id from paid back to sent - fixed by reordering the subtests. nix flake check passes clean. Also backfills two CHANGELOG.md gaps from earlier sessions: the VM test and CI additions had never actually been logged there. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
3.0 KiB
3.0 KiB
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog,
and this project adheres to Semantic Versioning.
Pre-1.0, per GOALS.md, a minor release can still break flags or output —
this file is where that gets written down instead of discovered at the
command line.
[Unreleased]
Added
- 33 resources, every one of them with a simple
list/get/create/update/deleteAPI in the SDK (resource_methods!/crud_methods!, no bulk/uploads/entity-actions) — seeinvoiceninja-cli --helpfor the full list.listtakes--allfor every page,--status, and--param key=valuefor anythingListParamsdoesn't have a typed setter for.quotesandcreditsareinvoicesunder different endpoints — Invoice Ninja stores all three in the same table, distinguished byentity_type, soQuoteandCreditare type aliases forInvoicein the SDK andcommands/quotes.rs/commands/credits.rsare otherwise identical tocommands/invoices.rs. Likewiserecurring_quotes/RecurringQuotemirrorrecurring_invoices/RecurringInvoice. updatefetches the current record, shallow-merges the caller's--data/--fileJSON on top, and writes the merged result back, rather than sending the patch alone — Invoice Ninja'sPUTis a full replace. SeeCLAUDE.mdand the comment insrc/body.rs.--output jsonon every command for the model's fullSerializeoutput (includingextra), suitable as input to a laterupdate/create; the default table view is a convenience subset of columns.- Global
--base-url,--token, and--api-passwordflags, each with a matching environment variable (IN_BASE_URL,IN_API_TOKEN,IN_API_PASSWORD); both secrets are hidden from--helpand any echoed default. - Depends on
invoiceninja-sdk0.2.0 from crates.io. - A
flake.nixwithdevShells.default,packages.default(built with a pinned toolchain), andoverlays.default(for pullinginvoiceninja-cliinto another flake's ownpkgs). - CI on GitHub Actions, mirroring
invoiceninja-sdk's ownci.yml: a pinned-toolchaintestjob, a build-onlymsrvjob on the declared 1.88 floor, and an advisorystablejob. nixosConfigurations.invoiceninja-test-nginx/-caddy(re-exported frominvoiceninja-nixos) and an automatedchecks.invoiceninja-clinixosTest that boots a real Invoice Ninja instance and runs this CLI's own binary against it. SeeCLAUDE.md's "Testing against a real server".invoices/quotes/credits/purchase-ordersgainaction <id> <action>(entity actions —mark_sent,mark_paid,archive,restore,clone_to_invoice,clone_to_quote,auto_bill,delete) anddownload <id>...(the rendered PDF, to stdout or--out <path>; more than one id streams a single merged PDF). These four are the only resources with the SDK'sentity_action_methods!route.