@fleetless/contracts 6.0.0 → 6.1.0-next.2

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 (41) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/artifacts/openapi.json +692 -1
  3. package/artifacts/routes.json +101 -0
  4. package/artifacts/schema/addon-catalogue-entry.schema.json +81 -0
  5. package/artifacts/schema/addon-key.schema.json +11 -0
  6. package/artifacts/schema/admin-plan-change-request.schema.json +189 -0
  7. package/artifacts/schema/asset-plan-limit-details.schema.json +115 -0
  8. package/artifacts/schema/audit-actor.schema.json +2 -1
  9. package/artifacts/schema/audit-event.schema.json +2 -1
  10. package/artifacts/schema/audit-list-response.schema.json +2 -1
  11. package/artifacts/schema/org-addons.schema.json +44 -0
  12. package/artifacts/schema/org-lock.schema.json +25 -0
  13. package/artifacts/schema/org-locked-details.schema.json +18 -0
  14. package/artifacts/schema/org-plan-usage.schema.json +51 -0
  15. package/artifacts/schema/org-plan.schema.json +500 -0
  16. package/artifacts/schema/pending-plan-change.schema.json +123 -0
  17. package/artifacts/schema/plan-catalogue-entry.schema.json +249 -0
  18. package/artifacts/schema/plan-change-keep.schema.json +49 -0
  19. package/artifacts/schema/plan-change-reason.schema.json +10 -0
  20. package/artifacts/schema/plan-change-request.schema.json +77 -0
  21. package/artifacts/schema/plan-currency.schema.json +8 -0
  22. package/artifacts/schema/plan-features.schema.json +44 -0
  23. package/artifacts/schema/plan-id.schema.json +10 -0
  24. package/artifacts/schema/plan-limit-details.schema.json +94 -0
  25. package/artifacts/schema/plan-limits.schema.json +121 -0
  26. package/artifacts/schema/plan-overrides.schema.json +111 -0
  27. package/artifacts/schema/plan-prices.schema.json +37 -0
  28. package/artifacts/schema/plan-required-details.schema.json +45 -0
  29. package/dist/audit.d.ts +10 -0
  30. package/dist/audit.js +8 -1
  31. package/dist/errors.d.ts +138 -1
  32. package/dist/errors.js +104 -0
  33. package/dist/index.d.ts +6 -2
  34. package/dist/index.js +11 -1
  35. package/dist/plans.d.ts +507 -0
  36. package/dist/plans.js +487 -0
  37. package/dist/realtime.d.ts +2 -0
  38. package/dist/realtime.js +6 -0
  39. package/dist/routes.d.ts +5 -1
  40. package/dist/routes.js +59 -0
  41. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -9,6 +9,48 @@ version.
9
9
 
10
10
  ## [Unreleased]
11
11
 
12
+ ### Added
13
+
14
+ - **The plan catalogue.** `src/plans.ts`: `planId` (`basic`, `plus`, `pro`,
15
+ `enterprise`, cheapest first in `PLAN_ORDER`), and per plan in `PLANS` the
16
+ limits (`planLimits`: `seats`, `robots`, `apps`, `app_users`,
17
+ `live_video_ms_per_month`, `asset_bytes_per_robot`, `history_days`,
18
+ `audit_days`; `null` means by contract), the feature flags
19
+ (`planFeatures`), the prices in integer cents excluding VAT
20
+ (`planPrices`: EUR and USD, monthly and yearly; `null` on request) and the
21
+ support tier. `ADDONS` lists the Pro add-ons and the limit each raises.
22
+ `usdCentsFromEurCents`, `yearlyEurCents` and `pricesFromEurMonth` state the
23
+ price rule (USD = EUR × 1.15 up to the next whole dollar, yearly = twelve
24
+ months less 15 %); `requiredPlanFor` and `nextPlanRaising` name the plan
25
+ that unlocks a feature or lifts a limit.
26
+ - **The organization's plan.** `GET /api/org/plan` (`orgPlan`): the plan, its
27
+ effective `limits` (the catalogue row raised by `addons` or an operator's
28
+ `overrides`), `features`, fresh `usage` (`orgPlanUsage`), any
29
+ `pending_change` (`pendingPlanChange`), an `orgLock` and, for an
30
+ organization still on the beta, `switch`. `PUT /api/org/plan/change`
31
+ (`planChangeRequest`, Owner tier) records the owner's move to a lower
32
+ plan or a cancellation; everything not named in `keep` (`planChangeKeep`)
33
+ is deleted when the change takes effect, never before: at
34
+ `period_ends_at`, at once for an org that is locked, or at the switch
35
+ date for an org still on the beta. `DELETE /api/org/plan/change` (Owner
36
+ tier) withdraws one still pending.
37
+ - **The admin plan route.** `PATCH /api/admin/orgs/:id/plan`
38
+ (`adminPlanChangeRequest`) lets the operator change an org's plan,
39
+ add-ons, limit overrides (`planOverrides`), currency or billing period at
40
+ once, never queued. A new `RouteAuth` value, `ops`: a bearer token the
41
+ operator holds (`OPS_API_TOKEN`), reachable only on the cloud's private
42
+ address — every public host answers `404` for `/api/admin/*`.
43
+ - **The plan errors.** `409 plan_limit` (`planLimitDetails`, or
44
+ `assetPlanLimitDetails` for an asset-storage refusal), `403 plan_required`
45
+ (`planRequiredDetails`) and `403 org_locked` (`orgLockedDetails`), answered
46
+ before anything is written.
47
+ - **Two small additive changes that ride with the plan work.**
48
+ `liveSessionEndReason` gains `plan_limit`: a live session ended because the
49
+ org's monthly video limit was reached. `auditActor.kind` gains `fleetless`,
50
+ for an event the platform recorded with no member behind it — the admin
51
+ plan route, a queued change landing, a lock taking effect, the beta
52
+ switch.
53
+
12
54
  ## [6.0.0] — 2026-10-02
13
55
 
14
56
  ### Added