@stewardhq/cli 0.10.0 → 0.12.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 +25 -36
- package/dist/bin.js +736 -86
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -20,11 +20,12 @@ ESM, Node ≥ 22. Its only runtime dependency is `@stewardhq/sdk`.
|
|
|
20
20
|
| `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
21
|
| `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
22
|
| `steward settings get` | `GET /v1/admin/settings` |
|
|
23
|
-
| `steward settings set [--app-url] [--privacy-url] [--terms-url] [--branding <json>] [--default-locale tr\|en] [--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>]` | `PATCH /v1/admin/settings`; an empty value clears the field (billing, metering and
|
|
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
24
|
| `steward endpoints list [--json]` | Endpoints and their last delivery |
|
|
25
25
|
| `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
26
|
| `steward endpoints rotate <id> --out <file> [--force]` | New secret to `--out`; the product transitions with `new,old` |
|
|
27
27
|
| `steward endpoints deactivate <id>` | Not reversible |
|
|
28
|
+
| `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 |
|
|
28
29
|
| `steward keys list [--json]` | The product's API keys: prefix, scope, status (active, expired, revoked), expiry, last use |
|
|
29
30
|
| `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) |
|
|
30
31
|
| `steward keys revoke <prefix>` | A key cannot revoke itself (use another admin key) |
|
|
@@ -35,12 +36,14 @@ ESM, Node ≥ 22. Its only runtime dependency is `@stewardhq/sdk`.
|
|
|
35
36
|
| `steward events redeliver <eventId>…` | Requeues every delivery of webhook events (admin) |
|
|
36
37
|
| `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 |
|
|
37
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) |
|
|
39
|
+
| `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 |
|
|
40
|
+
| `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`) |
|
|
38
41
|
|
|
39
42
|
Exit codes: 0 success, 1 error (or doctor not ready), 2 incorrect usage.
|
|
40
43
|
|
|
41
44
|
## Connection settings
|
|
42
45
|
|
|
43
|
-
- Admin commands (`catalog`, `settings`, `endpoints`, `keys`, `dunning`, `reprice`, `credits`,
|
|
46
|
+
- Admin commands (`catalog`, `settings`, `endpoints`, `email-smtp`, `keys`, `dunning`, `reprice`, `credits`,
|
|
44
47
|
`bank-transfers`, `invoices`, `meters recompute|close-periods`, `events redeliver`): `STEWARD_ADMIN_URL` +
|
|
45
48
|
`STEWARD_ADMIN_API_KEY`. The URL is the address where your steward serves `/v1`, for example
|
|
46
49
|
`https://billing.example.com`: its public address if the deployment exposes `/v1` there,
|
|
@@ -67,6 +70,9 @@ Exit codes: 0 success, 1 error (or doctor not ready), 2 incorrect usage.
|
|
|
67
70
|
newline). If the file exists, no request is sent without `--force`; if the request fails, no
|
|
68
71
|
secret file is left behind. The operator moves the secret into the product's Secret and
|
|
69
72
|
deletes the file.
|
|
73
|
+
- `email-smtp set`: the SMTP URL (it carries the mailbox password) is read from `--file` or `--stdin`, never
|
|
74
|
+
from an argument (shell history) or an interactive terminal (echo); it is validated before the request and
|
|
75
|
+
never printed. Delete the file afterwards.
|
|
70
76
|
- The CLI does not call `kubectl`; creating Secrets and rolling out is the operator's job.
|
|
71
77
|
|
|
72
78
|
## Catalog file
|
|
@@ -135,42 +141,25 @@ capability: an older steward would drop the key and offer the plan.
|
|
|
135
141
|
|
|
136
142
|
Release: bump the version in `cli/package.json` and push the `cli-v<version>` tag
|
|
137
143
|
(`.github/workflows/cli-publish.yml`); the `@stewardhq/sdk` version it depends on must already
|
|
138
|
-
be published on npm.
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
- **0.
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
`
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
-
|
|
151
|
-
|
|
152
|
-
`bank-transfers
|
|
153
|
-
the
|
|
154
|
-
`listed: false`. Help, errors, `doctor` and `endpoints` output and the connection line are now
|
|
155
|
-
in English (they were partly Turkish); flags, command names, JSON output and exit codes are
|
|
156
|
-
unchanged.
|
|
157
|
-
- **0.7.0** (`@stewardhq/sdk` 0.7, admin operations, issue #57): `steward keys`, `steward dunning`,
|
|
158
|
-
`steward reprice`, `steward credits adjust`, `steward bank-transfers`, `steward meters recompute` and
|
|
159
|
-
`close-periods`, `steward events redeliver`, `settings set --provider`. These replace the pod CLI
|
|
160
|
-
commands of the same jobs. `doctor` lists the active API keys with age, last use and expiry; the
|
|
161
|
-
connection hint names the public admin host.
|
|
162
|
-
- **0.5.0** (`@stewardhq/sdk` 0.5, metering phase 2): `steward meters get`, `steward events
|
|
163
|
-
send`; meter, credit and metered price diff in `catalog push` (a metered price change asks
|
|
164
|
-
for confirmation; a catalog with meters is not pushed without the `meters` capability);
|
|
165
|
-
`settings set --metering-charge-mode`, `--metering-late-grace-minutes`,
|
|
166
|
-
`--events-retention-days`; the `metering` line in `doctor` plus the report's `events` and
|
|
167
|
-
`overage` sections.
|
|
168
|
-
- **0.4.0** (`@stewardhq/sdk` 0.4, billing core phase 1): benefit and price diff, price change
|
|
169
|
-
confirmation, the `benefits` capability gate, `settings set --billing-*`; `steward dev`
|
|
170
|
-
removed (breaking).
|
|
144
|
+
be published on npm. The notes of 0.4.0 to 0.10.0 are in
|
|
145
|
+
[this file at `cli-v0.10.0`](https://github.com/z9cloud/steward/blob/cli-v0.10.0/cli/README.md#versions).
|
|
146
|
+
|
|
147
|
+
- **0.12.0** (`@stewardhq/sdk` 0.12): `steward email-smtp get|set --file|--stdin|clear|verify` (the product's own
|
|
148
|
+
SMTP account for its billing emails; needs a steward with `/v1/admin/email-smtp`). `steward doctor` shows which
|
|
149
|
+
SMTP the emails go through, the product account's host and its recent failures.
|
|
150
|
+
- **0.11.0** (`@stewardhq/sdk` 0.11, which removes the contract names steward no longer produces):
|
|
151
|
+
`steward grants list` (the product's active grants and their accounts' live subscriptions; needs a steward with
|
|
152
|
+
`GET /v1/admin/grants`). `steward settings set --display-time-zone <iana>` (the zone of customer-facing dates;
|
|
153
|
+
`""` restores `Europe/Istanbul`). `steward tax thresholds list|set|delete` and `steward tax sales` (needs a steward
|
|
154
|
+
with `/v1/admin/tax/thresholds` and `/v1/admin/sales`); `steward settings set --tax-provider`,
|
|
155
|
+
`--tax-exemption-reason-en|-tr`, `--consumer-markets`. `steward settings set --default-country <XX>`,
|
|
156
|
+
`--billing-renewal-notice-intervals`, `--billing-renewal-notice-days`, `--billing-invoice-line-text iso|localized`,
|
|
157
|
+
`--seller`, `--withdrawal-waiver`, `--card-on-file`. `steward invoices list --from|--to` and `--csv` (the export
|
|
158
|
+
for an accounting system). `steward bank-transfers record --override-billing-currency`. `steward doctor` shows
|
|
159
|
+
the provider's webhook, automatic renewal and the legal settings.
|
|
171
160
|
|
|
172
161
|
When packed, the `@stewardhq/sdk` dependency turns from `workspace:^` into the range of the
|
|
173
|
-
SDK version current at that time (0.
|
|
162
|
+
SDK version current at that time (0.12.0 → `^0.12.0`).
|
|
174
163
|
|
|
175
164
|
## License
|
|
176
165
|
|