refactor(pwa): paid auto-rotation runs on @profullstack/key-rotation

The checkout, webhook settle, return check and expiry/renewal sweep from #272
move into the new @profullstack/key-rotation package (0.1.0) so other fleet
apps can sell the same add-on. lib/auto-rotation.mjs keeps its exports and
binds the package to credshare_teams, owners/admins, the audit log and the
app.logicsrc.com CoinPay business. No schema or behaviour change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Anthony Ettinger 2026-10-29 05:33:49 +00:00
parent 0cfb94e56c
commit fadb6338f5
4 changed files with 62 additions and 152 deletions

View file

@ -147,6 +147,12 @@ the switch off, so due keys wait for approval again. A team switched on by hand
(`rotation_auto_approve = 1` with `rotation_auto_paid_until` NULL) never
expires. State: `GET /api/credshare/teams/:slug/rotation/auto`.
The billing logic (checkout, webhook settle, return check, sweep) is the
[`@profullstack/key-rotation`](https://github.com/profullstack/key-rotation)
package; `apps/pwa/src/lib/auto-rotation.mjs` only binds it to `credshare_teams`,
the audit log and this app's CoinPay business, so other fleet apps can sell the
same add-on.
```sh
logicsrc teams rotate-keys profullstack --queue-due
logicsrc teams rotation-approve profullstack <run-id>