@stewardhq/cli 0.6.0 → 0.8.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.
Files changed (3) hide show
  1. package/README.md +34 -8
  2. package/dist/bin.js +1309 -603
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -14,7 +14,7 @@ ESM, Node ≥ 22. Its only runtime dependency is `@stewardhq/sdk`.
14
14
  | Command | What it does |
15
15
  | --- | --- |
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
- | `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 (`GET /v1/me`) |
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 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 |
19
19
  | `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 |
20
20
  | `steward settings get` | `GET /v1/admin/settings` |
@@ -23,15 +23,25 @@ ESM, Node ≥ 22. Its only runtime dependency is `@stewardhq/sdk`.
23
23
  | `steward endpoints add --url <url> --out <file> [--event-types a,b] [--description <text>] [--force]` | Generates the secret locally and writes it only to `--out` |
24
24
  | `steward endpoints rotate <id> --out <file> [--force]` | New secret to `--out`; the product transitions with `new,old` |
25
25
  | `steward endpoints deactivate <id>` | Not reversible |
26
+ | `steward keys list [--json]` | The product's API keys: prefix, scope, status (active, expired, revoked), expiry, last use |
27
+ | `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) |
28
+ | `steward keys revoke <prefix>` | A key cannot revoke itself (use another admin key) |
29
+ | `steward dunning get [--json]` / `steward dunning set <policy.json> [--yes]` | `GET/PUT /v1/admin/dunning-policy`; turning dry run off asks for confirmation |
30
+ | `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 |
31
+ | `steward meters recompute <ref> [--meter <code>]` / `steward meters close-periods <ref> [--meter <code>] [--force]` | Metering repairs (admin) |
32
+ | `steward credits adjust <ref> <meter> --units=<n> --reason <text>` | A credit ledger entry; negative units = adjustment |
33
+ | `steward events redeliver <eventId>…` | Requeues every delivery of webhook events (admin) |
34
+ | `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 |
26
35
 
27
36
  Exit codes: 0 success, 1 error (or doctor not ready), 2 incorrect usage.
28
37
 
29
38
  ## Connection settings
30
39
 
31
- - Admin commands (`catalog`, `settings`, `endpoints`): `STEWARD_ADMIN_URL` +
32
- `STEWARD_ADMIN_API_KEY`. In a cluster the admin endpoint is reached through a port-forward
33
- (e.g. `kubectl -n steward port-forward svc/steward 13002:80` → `http://localhost:13002`); the
34
- key comes from the operator.
40
+ - Admin commands (`catalog`, `settings`, `endpoints`, `keys`, `dunning`, `reprice`, `credits`,
41
+ `bank-transfers`, `meters recompute|close-periods`, `events redeliver`): `STEWARD_ADMIN_URL` +
42
+ `STEWARD_ADMIN_API_KEY`. The admin API is reachable through the public host once `/v1` is exposed;
43
+ otherwise through a port-forward (e.g. `kubectl -n steward port-forward svc/steward 13002:80` →
44
+ `http://localhost:13002`). The key comes from the operator.
35
45
  - `doctor`, `meters`, `events`: `STEWARD_URL` + `STEWARD_API_KEY`; if neither is set, the admin
36
46
  pair. A half pair (only the URL or only the key) does not fall back to the other pair — it
37
47
  fails with a clear error.
@@ -42,9 +52,8 @@ Exit codes: 0 success, 1 error (or doctor not ready), 2 incorrect usage.
42
52
  `.env.local`. That way, when the environment is set for a port-forwarded production target,
43
53
  a product repo's `.env.local` cannot redirect it.
44
54
  - Commands print the source they used to stderr (not the values — the pair names and the
45
- origin). Some CLI output is still in Turkish for historical reasons, so this line currently
46
- reads: `bağlantı: ortam · STEWARD_ADMIN_URL + STEWARD_ADMIN_API_KEY → http://localhost:13002`
47
- (`ortam` = environment, the alternative being `.env.local`).
55
+ origin), e.g. `connection: environment · STEWARD_ADMIN_URL + STEWARD_ADMIN_API_KEY →
56
+ http://localhost:13002` (the source is `environment` or `.env.local`).
48
57
  - Changes carry `X-Actor-Ref: operator:<operating system user>`.
49
58
 
50
59
  ## Secrets
@@ -82,6 +91,11 @@ counted a period: steward refuses the push with `422 meter_locked`, and the new
82
91
  meter code. A catalog with `meters` or `meteredPrices` is pushed only when `GET /v1/me` lists the
83
92
  `meters` capability.
84
93
 
94
+ Unlisted plans: a plan with `listed: false` is sellable but not offered in the hosted portal's
95
+ "Change plan". The diff shows a plan that becomes unlisted, or listed again (`plan listing`). A
96
+ catalog with an unlisted plan is pushed only when `GET /v1/me` lists the `unlisted_plans`
97
+ capability: an older steward would drop the key and offer the plan.
98
+
85
99
  ## Meters and events
86
100
 
87
101
  - `steward meters get <ref>` prints the account's meter reading (the numbers the product sees
@@ -104,6 +118,18 @@ Release: bump the version in `cli/package.json` and push the `cli-v<version>` ta
104
118
  be published on npm. **The first version on npmjs is 0.5.0** (2026-09-21); 0.4.0 was not
105
119
  published.
106
120
 
121
+ - **0.8.0** (`@stewardhq/sdk` 0.8, bank transfers in another currency, issue #55):
122
+ `bank-transfers record --rate`, `bank-transfers list --rate [--currency]`,
123
+ `bank-transfers fx-report [--from] [--to] [--json|--csv]`. Unlisted plans: `catalog push` shows
124
+ the `plan listing` diff and requires the `unlisted_plans` capability for a plan with
125
+ `listed: false`. Help, errors, `doctor` and `endpoints` output and the connection line are now
126
+ in English (they were partly Turkish); flags, command names, JSON output and exit codes are
127
+ unchanged.
128
+ - **0.7.0** (`@stewardhq/sdk` 0.7, admin operations, issue #57): `steward keys`, `steward dunning`,
129
+ `steward reprice`, `steward credits adjust`, `steward bank-transfers`, `steward meters recompute` and
130
+ `close-periods`, `steward events redeliver`, `settings set --provider`. These replace the pod CLI
131
+ commands of the same jobs. `doctor` lists the active API keys with age, last use and expiry; the
132
+ connection hint names the public admin host (`STEWARD_ADMIN_URL=https://billing.zone9.cloud`).
107
133
  - **0.5.0** (`@stewardhq/sdk` 0.5, metering phase 2): `steward meters get`, `steward events
108
134
  send`; meter, credit and metered price diff in `catalog push` (a metered price change asks
109
135
  for confirmation; a catalog with meters is not pushed without the `meters` capability);