@fleetless/contracts 6.3.0-next.4 → 6.3.0-next.5

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 (32) hide show
  1. package/CHANGELOG.md +9 -49
  2. package/artifacts/openapi.json +1841 -4344
  3. package/artifacts/routes.json +5 -330
  4. package/dist/errors.d.ts +5 -17
  5. package/dist/errors.js +6 -31
  6. package/dist/index.d.ts +2 -4
  7. package/dist/index.js +1 -5
  8. package/dist/plans.d.ts +9 -9
  9. package/dist/realtime.d.ts +2 -2
  10. package/dist/rest.d.ts +11 -10
  11. package/dist/rest.js +8 -7
  12. package/dist/routes.d.ts +1 -1
  13. package/dist/routes.js +12 -200
  14. package/package.json +1 -1
  15. package/artifacts/schema/billing-address.schema.json +0 -49
  16. package/artifacts/schema/billing-cancel-request.schema.json +0 -12
  17. package/artifacts/schema/billing-change-request.schema.json +0 -60
  18. package/artifacts/schema/billing-change-response.schema.json +0 -799
  19. package/artifacts/schema/billing-details-update.schema.json +0 -25
  20. package/artifacts/schema/billing-details.schema.json +0 -176
  21. package/artifacts/schema/billing-invoice.schema.json +0 -76
  22. package/artifacts/schema/billing-view.schema.json +0 -705
  23. package/artifacts/schema/checkout-request.schema.json +0 -252
  24. package/artifacts/schema/checkout-response.schema.json +0 -22
  25. package/artifacts/schema/checkout-status.schema.json +0 -49
  26. package/artifacts/schema/payment-method-change-request.schema.json +0 -19
  27. package/artifacts/schema/payment-method.schema.json +0 -86
  28. package/artifacts/schema/payment-provider-unavailable-details.schema.json +0 -29
  29. package/artifacts/schema/vat-id-check-request.schema.json +0 -22
  30. package/artifacts/schema/vat-id-check-response.schema.json +0 -36
  31. package/dist/billing.d.ts +0 -812
  32. package/dist/billing.js +0 -471
package/CHANGELOG.md CHANGED
@@ -11,58 +11,18 @@ version.
11
11
 
12
12
  ### Added
13
13
 
14
- - **Billing.** `src/billing.ts`: `EU_COUNTRIES`, `countryCode`,
15
- `currencyForCountry`, `normalizeVatId` and `viesCountry`; `vatFor`, who
16
- may pay and at which VAT rate (Germany 19 %, a company in another EU
17
- country with a VAT ID VIES confirms 0 % reverse charge, outside the EU
18
- 0 %, everyone else refused with a named rule); the money functions in
19
- integer cents (`periodNetCents`, `periodDays`, `remainingDays`,
20
- `prorateCents`, `changeNetCents`, `chargeAmounts`, `checkoutQuote`); and
21
- the dunning schedule `BILLING_RETRY_DAYS` and `BILLING_LOCK_DAY`.
22
- - **The billing read model and requests.** `billingView` (the account, the
23
- payment method on file, the `payment_method_options` a change may offer
24
- now, the last 24 invoices), `billingAccount`, `billingInvoice`,
25
- `paymentMethod`, `billingDetails` and `billingAddress`;
26
- the requests `checkoutRequest`, `vatIdCheckRequest`,
27
- `billingChangeRequest` (absolute counts, not deltas),
28
- `billingCancelRequest`, `billingDetailsUpdate` and
29
- `paymentMethodChangeRequest`; the answers `checkoutResponse`,
30
- `checkoutStatus`, `vatIdCheckResponse` and `billingChangeResponse`. Each
31
- has a JSON Schema in `artifacts/schema/`.
32
- - **Card, PayPal and Apple Pay.** `paymentMethodKind`
33
- (`card | paypal | applepay`) is what `paymentMethodChangeRequest` names
34
- and what `paymentMethod` shows: `applepay` carries the card fields,
35
- because Mollie stores an Apple Pay mandate as a card mandate. A change
36
- to Apple Pay may be refused with `400 validation_error`, rule
37
- `applepay_needs_open_invoice`, where it can only be made while paying an
38
- open invoice; `payment_method_options` says which applies.
39
- - **The VAT-ID hold and chargebacks** (descriptions only). A renewal held
40
- by the VAT ID is a due charge without an invoice number until it is
41
- paid: `dunning.invoice_id` names it, `failure` is `vat_id_invalid`, and
42
- `POST /api/billing/invoices/:id/pay` answers `409 target_state_conflict`,
43
- rule `vat_id_invalid`, while it is held. A charged-back payment is never
44
- recharged automatically: `next_retry_at` is `null`, `failure` is
45
- `charged_back`.
46
- - **The `billing` route section**, twelve routes: `GET /api/billing`, the
47
- checkout and its status, the VAT-ID check, billing details, changes,
48
- the payment method, cancel and resume, an invoice's PDF and paying an
49
- open invoice, all owner-tier; and Mollie's webhook
50
- (`POST /api/billing/mollie/webhook`, internal, no auth).
51
- - **`billing_unavailable`** (`503`): this cloud has no payment provider
52
- configured, so it takes no payments. Retrying does not help.
53
- - **`payment_provider_unavailable`** (`502`): Mollie did not answer, or
54
- answered with an error; nothing was charged. `details` is
55
- `paymentProviderUnavailableDetails` (`provider`, Mollie's HTTP `status`
56
- or `null` for a timeout). Retrying may work.
14
+ - **`history_migrating`** (`409`): a slug rename refused while the robot's
15
+ recorded history is being migrated to a new storage layout. Temporary;
16
+ nothing is written, and the same request succeeds once the migration has
17
+ finished. Listed on `POST /api/robots/:id/config/rename-slug`. A consumer
18
+ that switches exhaustively over `ErrorCode` gains one case.
57
19
 
58
20
  ### Changed
59
21
 
60
- - **`PATCH /api/admin/orgs/:id/plan`** lists `target_state_conflict`: rule
61
- `billed` when the org has a billing account and the change would touch
62
- its currency or period.
63
- - The notes of **`PUT /api/org/plan/change`** and the admin route no longer
64
- say payment is missing; an upgrade of a billed org goes through the
65
- billing routes.
22
+ - `POST /api/robots/:id/config/rename-slug`: the summary and notes, and the
23
+ `renameSlugRequest` doc comment, now say the history moves with the name
24
+ without rewriting stored samples, and that samples sent under the old slug
25
+ before the publish join the renamed history. No wire shape changed.
66
26
 
67
27
  ## [6.2.0] — 2026-10-04
68
28