@stewardhq/cli 0.12.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -6
- package/dist/bin.js +967 -400
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -16,15 +16,17 @@ ESM, Node ≥ 22. Its only runtime dependency is `@stewardhq/sdk`.
|
|
|
16
16
|
| `steward doctor [--json]` | `GET /v1/doctor`; `APP_URL` ↔ steward `appUrl` / return origins. Exits 1 when not ready. For a product with meters, a `metering` line (the catalog's meters and metered prices, and steward's `events`, `meters`, `overage` capabilities) plus the report's `events` section (backlog, rollup lag, unmatched event names in the last 7 days' sample, invalid values, meters receiving no events) and `overage` section (`chargeMode`, metered price, subscriptions with no locked rate, rolled-over records) |
|
|
17
17
|
| `steward catalog push <file> [--yes]` | `PUT /v1/admin/catalog`; version and counts. Before the push: benefit, price, meter, credit and metered price diff against the current catalog; price and metered price changes need confirmation (prompt, or `--yes`); a catalog with benefits needs the `benefits` capability, one with meters the `meters` capability, one with an unlisted plan the `unlisted_plans` capability (`GET /v1/me`) |
|
|
18
18
|
| `steward accounts get <ref> [--include a,b] [--json]` | `GET /v1/accounts/:ref`: name, plan, the primary subscription and the metadata; `--include` adds `profile`, `subscriptions`, `checkouts`, `payments`, `invoices`, `grants` |
|
|
19
|
+
| `steward accounts list [--search <text>] [--status <status>] [--plan <code>] [--deleted exclude\|include\|only] [--limit <n>] [--after <ref>] [--json]` | `GET /v1/admin/accounts` (admin): finds accounts without their exact ref. The product's accounts in ref order, one line per account with its billing currency and live subscriptions; deleted accounts are left out unless `--deleted include\|only` (shown as `(deleted <time>)`). `--search`: the ref starts with it or the display name contains it (case-insensitive); `--status` / `--plan`: accounts with such a subscription (`--plan` alone: a live one; an unknown code is refused). No personal data. A cut list names the next `--after` on stderr |
|
|
19
20
|
| `steward accounts metadata set <ref> <key>=<value>… [--reason <text>] [--json]` / `steward accounts metadata unset <ref> <key>… [--reason <text>] [--json]` | `PATCH /v1/accounts/:ref/metadata`: sets or removes single metadata keys and leaves the others as they are; prints each key before → after. Needs the `account_metadata` capability (`GET /v1/me`); never creates an account |
|
|
20
21
|
| `steward meters get <ref> [--periods <n>] [--json]` | `GET /v1/accounts/:ref/meters`: per meter the open period, usage, credit, balance, standing and estimated overage; `--periods` adds the most recent closed periods |
|
|
21
22
|
| `steward events send <ref> <name> [--meta k=v]… [--external-id <id>] [--timestamp <iso>] [--json]` | A single event via `POST /v1/events/ingest` (for local trials); when `externalId` is omitted one is generated and printed. Exits 1 on a rejected event |
|
|
22
23
|
| `steward settings get` | `GET /v1/admin/settings` |
|
|
23
|
-
| `steward settings set [--app-url] [--privacy-url] [--terms-url] [--branding <json>] [--default-locale tr\|en] [--display-time-zone <iana>] [--default-country <XX>] [--checkout-ttl <min>] [--portal-ttl <min>] [--extra-return-origins a,b] [--emails <json>] [--billing-payment-due-days <1-60>] [--billing-min-invoice-minor <n>] [--billing-allow-multiple-subscriptions true\|false] [--metering-charge-mode off\|dry_run\|live] [--metering-late-grace-minutes <0-1440>] [--events-retention-days <45-400>] [--tax-provider price\|none] [--tax-exemption-reason-en <text>] [--tax-exemption-reason-tr <text>] [--consumer-markets <XX,YY>]` | `PATCH /v1/admin/settings`; an empty value clears the field (billing, metering, events and tax flags: restores the default) |
|
|
24
|
+
| `steward settings set [--app-url] [--privacy-url] [--terms-url] [--branding <json>] [--default-locale tr\|en] [--display-time-zone <iana>] [--default-country <XX>] [--checkout-ttl <min>] [--portal-ttl <min>] [--extra-return-origins a,b] [--public-url <url>] [--emails <json>] [--billing-payment-due-days <1-60>] [--billing-min-invoice-minor <n>] [--billing-allow-multiple-subscriptions true\|false] [--metering-charge-mode off\|dry_run\|live] [--metering-late-grace-minutes <0-1440>] [--events-retention-days <45-400>] [--tax-provider price\|none] [--tax-exemption-reason-en <text>] [--tax-exemption-reason-tr <text>] [--consumer-markets <XX,YY>]` | `PATCH /v1/admin/settings`; an empty value clears the field (billing, metering, events and tax flags: restores the default) |
|
|
24
25
|
| `steward endpoints list [--json]` | Endpoints and their last delivery |
|
|
25
26
|
| `steward endpoints add --url <url> --out <file> [--event-types a,b] [--description <text>] [--force]` | Generates the secret locally and writes it only to `--out` |
|
|
26
27
|
| `steward endpoints rotate <id> --out <file> [--force]` | New secret to `--out`; the product transitions with `new,old` |
|
|
27
28
|
| `steward endpoints deactivate <id>` | Not reversible |
|
|
29
|
+
| `steward discounts list [--archived] [--json]` / `steward discounts create --name <text> (--percent <n> \| --amount <CUR:minor>…) --duration once\|repeating\|forever [--months <n>] [--code <code>] [--plans a,b] [--starts <iso>] [--ends <iso>] [--max <n>] [--per-customer <n>\|unlimited]` / `steward discounts update <id> […]` / `steward discounts archive <id> [--yes]` | Discounts and discount codes (`/v1/admin/discounts`): a share or an amount per currency off a plan's base price, for the first invoice, a number of months or every invoice. `update` takes `none` to clear an optional field; the value and duration are fixed once redeemed. `create` warns when a sellable price would fall under the payment provider's minimum |
|
|
28
30
|
| `steward email-smtp get [--json]` / `steward email-smtp set --file <path> \| --stdin` / `steward email-smtp clear [--yes]` / `steward email-smtp verify [--to <address>] [--json]` | The product's own SMTP account for its billing emails (`/v1/admin/email-smtp`; otherwise the installation's). `set` reads the URL (`smtp://user:pass@host:587` or `smtps://…:465`) from a file or a pipe, never from an argument or a terminal; steward never returns it (`get` shows the host). `verify` asks `MAIL FROM` (the product's sender) and `RCPT TO`, stops before `DATA`, and exits 1 with the failed step and the server's reply when the account refuses |
|
|
29
31
|
| `steward keys list [--json]` | The product's API keys: prefix, scope, status (active, expired, revoked), expiry, last use |
|
|
30
32
|
| `steward keys create --name <n> --scope product\|checkout\|admin --out <file> [--expires-days <n> \| --no-expiry] [--force]` | Generates the key locally and writes it only to `--out`; steward stores its hash. An admin key always expires (default 90 days) |
|
|
@@ -33,22 +35,27 @@ ESM, Node ≥ 22. Its only runtime dependency is `@stewardhq/sdk`.
|
|
|
33
35
|
| `steward reprice --plan <code> --notice-days <n> [--dry-run] [--yes] [--json]` | Moves a plan's subscribers to its current price and metered rates; always lists first (dry run), then asks for confirmation |
|
|
34
36
|
| `steward meters recompute <ref> [--meter <code>]` / `steward meters close-periods <ref> [--meter <code>] [--force]` | Metering repairs (admin) |
|
|
35
37
|
| `steward credits adjust <ref> <meter> --units=<n> --reason <text>` | A credit ledger entry; negative units = adjustment |
|
|
38
|
+
| `steward events list [--account <ref>] [--type <type>] [--delivery pending\|delivered\|dead\|failed] [--limit <n>] [--after <event id>] [--json]` | `GET /v1/admin/events` (admin): the product's webhook events, newest first, each with its delivery to every endpoint (status, attempts, last error code, e.g. `dead 8× http_500`). `--delivery failed`: dead, or pending after a failed attempt; redeliver those with `steward events redeliver`. A cut list names the next `--after` on stderr |
|
|
36
39
|
| `steward events redeliver <eventId>…` | Requeues every delivery of webhook events (admin) |
|
|
37
40
|
| `steward bank-transfers list [--status pending\|expired] [--rate <rate>]` / `steward bank-transfers record <code> --amount <minor> --currency <CUR> --received-at <iso> --bank-ref <ref> [--rate <rate>] […] [--yes]` / `steward bank-transfers fx-report [--from <iso>] [--to <iso>] [--json\|--csv]` | Bank transfer reconciliation; recording asks for confirmation. `--rate`: a transfer in another currency than the item's, at the exchange rate you enter (`list --rate` previews the expected amounts); `fx-report`: those payments for the accountant |
|
|
38
|
-
| `steward invoices list [--status draft\|issued\|void\|all] [--payment-status <status>] [--limit <n>] [--json]` / `steward invoices issue <id> --number <number> [--external-ref <ref>] [--issued-at <iso>] [--document <file.pdf>] [--yes]` | `GET /v1/admin/invoices`: the invoices not cut in the external system yet (`draft`, the default), oldest first; `POST /v1/invoices/:id/issue`: writes the external invoice number and marks the invoice issued (once; asks for confirmation, the customer is emailed) |
|
|
41
|
+
| `steward invoices list [--status draft\|issued\|void\|all] [--payment-status <status>] [--limit <n>] [--after <invoice id>] [--json]` / `steward invoices issue <id> --number <number> [--external-ref <ref>] [--issued-at <iso>] [--document <file.pdf>] [--yes]` | `GET /v1/admin/invoices`: the invoices not cut in the external system yet (`draft`, the default), oldest first; a cut list names the next `--after` on stderr. `POST /v1/invoices/:id/issue`: writes the external invoice number and marks the invoice issued (once; asks for confirmation, the customer is emailed) |
|
|
39
42
|
| `steward grants list [--plan <code>] [--subscription none\|live\|any] [--limit <n>] [--after <grant id>] [--json]` | `GET /v1/admin/grants`: the product's active grants (not revoked, started, not ended), one line per grant, with the account and its live subscriptions. `--subscription none`: accounts with no live subscription, e.g. granted a plan but paying for nothing; `--plan`: one plan's grants (an unknown code is refused). A cut list names the next `--after` on stderr |
|
|
43
|
+
| `steward audit list [--account <ref>] [--action <action>] [--api-key <prefix>] [--console-user <id>] [--source <source>] [--from <iso>] [--to <iso>] [--limit <n>] [--after <id>] [--json]` | `GET /v1/admin/audit`: the product's audit trail, newest first: time, action, account, who wrote the row (`key <prefix>` for a `/v1` request, `console <id>` for an operator console request, otherwise the source: `job:<name>`, `cli`, `hosted`, `provider_webhook`) and the actor the caller reported; `--json` adds the request id and each row's `detail`. A cut list names the next `--after` on stderr |
|
|
44
|
+
| `steward emails list [--account <ref>] [--status pending\|sent\|skipped\|dead] [--template <name>] [--limit <n>] [--after <id>] [--json]` | `GET /v1/admin/emails`: the billing emails steward queued for the product's accounts, newest first: template, status, account, attempts and the last error code or skip reason. Recipient addresses are never stored or listed. A cut list names the next `--after` on stderr |
|
|
45
|
+
| `steward payments list [--account <ref>] [--method card\|bank_transfer] [--disputed any\|open\|ever] [--from <iso>] [--to <iso>] [--limit <n>] [--after <id>] [--json]` | `GET /v1/admin/payments`: the product's collected payments, newest collection first: account, method, amount, refunded and the dispute (provider status, open or closed). Only successful payments are recorded. A cut list names the next `--after` on stderr |
|
|
40
46
|
| `steward tax thresholds list [--json]` / `steward tax thresholds set <code> --scope <scope> --currency <CUR> [--amount-minor <n>] [--transactions <n>] [--country <XX>] [--region <XX>] [--home-country <XX>] [--period calendar_year\|rolling_12_months] [--warn-at-bps <n>] [--fx-rate <CUR>=<rate>]… [--note <text>]` / `steward tax thresholds delete <code>` / `steward tax sales [--from <iso>] [--to <iso>] [--json\|--csv]` | Tax registration thresholds (`/v1/admin/tax/thresholds`; none ship, the accountant defines them; `set` replaces one whole, audited) with each one's counted sales, share and status; `sales`: paid sales per month, buyer country, region, kind, currency and tax treatment (`GET /v1/admin/sales`) |
|
|
41
47
|
|
|
42
48
|
Exit codes: 0 success, 1 error (or doctor not ready), 2 incorrect usage.
|
|
43
49
|
|
|
44
50
|
## Connection settings
|
|
45
51
|
|
|
46
|
-
- Admin commands (`catalog`, `settings`, `endpoints`, `email-smtp`, `keys`, `dunning`, `reprice`, `credits`,
|
|
47
|
-
`bank-transfers`, `invoices`, `meters recompute|close-periods`, `events redeliver
|
|
52
|
+
- Admin commands (`catalog`, `settings`, `endpoints`, `discounts`, `email-smtp`, `keys`, `dunning`, `reprice`, `credits`,
|
|
53
|
+
`bank-transfers`, `invoices`, `grants`, `accounts list`, `meters recompute|close-periods`, `events list|redeliver`,
|
|
54
|
+
`audit`, `emails`, `payments`): `STEWARD_ADMIN_URL` +
|
|
48
55
|
`STEWARD_ADMIN_API_KEY`. The URL is the address where your steward serves `/v1`, for example
|
|
49
56
|
`https://billing.example.com`: its public address if the deployment exposes `/v1` there,
|
|
50
57
|
otherwise an address inside its network. The key comes from the operator.
|
|
51
|
-
- `doctor`, `accounts`, `meters`, `events`: `STEWARD_URL` + `STEWARD_API_KEY`; if neither is set, the admin
|
|
58
|
+
- `doctor`, `accounts get|metadata`, `meters get`, `events send`: `STEWARD_URL` + `STEWARD_API_KEY`; if neither is set, the admin
|
|
52
59
|
pair. A half pair (only the URL or only the key) does not fall back to the other pair — it
|
|
53
60
|
fails with a clear error.
|
|
54
61
|
- **The source is chosen as a whole.** If even one of `STEWARD_URL`, `STEWARD_API_KEY`,
|
|
@@ -144,6 +151,15 @@ Release: bump the version in `cli/package.json` and push the `cli-v<version>` ta
|
|
|
144
151
|
be published on npm. The notes of 0.4.0 to 0.10.0 are in
|
|
145
152
|
[this file at `cli-v0.10.0`](https://github.com/z9cloud/steward/blob/cli-v0.10.0/cli/README.md#versions).
|
|
146
153
|
|
|
154
|
+
- **0.14.0** (`@stewardhq/sdk` 0.14): `steward accounts list`, `steward events list`, `steward audit list`,
|
|
155
|
+
`steward emails list` and `steward payments list` (product-wide lists, paged with `--limit` / `--after`; need a
|
|
156
|
+
steward with `/v1/admin/accounts`, `/events`, `/audit`, `/emails` and `/payments`, 0.14.0 or later);
|
|
157
|
+
`steward invoices list --after`. `steward settings set --public-url` (the product's hosted links on another
|
|
158
|
+
address the deployment serves; needs steward 0.14.0). `catalog push` computes its diff with the SDK's
|
|
159
|
+
`diffCatalogSync`, which follows steward's sync in the edge cases where the CLI's own copy differed.
|
|
160
|
+
- **0.13.0** (`@stewardhq/sdk` 0.13): `steward discounts list|create|update|archive` (discounts and discount codes;
|
|
161
|
+
needs a steward with `/v1/admin/discounts`, 0.13.0 or later). `create` warns when a sellable price would fall
|
|
162
|
+
under the payment provider's minimum.
|
|
147
163
|
- **0.12.0** (`@stewardhq/sdk` 0.12): `steward email-smtp get|set --file|--stdin|clear|verify` (the product's own
|
|
148
164
|
SMTP account for its billing emails; needs a steward with `/v1/admin/email-smtp`). `steward doctor` shows which
|
|
149
165
|
SMTP the emails go through, the product account's host and its recent failures.
|
|
@@ -159,7 +175,7 @@ be published on npm. The notes of 0.4.0 to 0.10.0 are in
|
|
|
159
175
|
the provider's webhook, automatic renewal and the legal settings.
|
|
160
176
|
|
|
161
177
|
When packed, the `@stewardhq/sdk` dependency turns from `workspace:^` into the range of the
|
|
162
|
-
SDK version current at that time (0.
|
|
178
|
+
SDK version current at that time (0.14.0 → `^0.14.0`).
|
|
163
179
|
|
|
164
180
|
## License
|
|
165
181
|
|