@fleetless/contracts 6.0.0 → 6.1.0-next.1

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 +40 -0
  2. package/artifacts/openapi.json +636 -1
  3. package/artifacts/routes.json +101 -0
  4. package/artifacts/schema/addon-catalogue-entry.schema.json +75 -0
  5. package/artifacts/schema/addon-key.schema.json +11 -0
  6. package/artifacts/schema/admin-plan-change-request.schema.json +171 -0
  7. package/artifacts/schema/asset-plan-limit-details.schema.json +108 -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 +39 -0
  12. package/artifacts/schema/org-lock.schema.json +23 -0
  13. package/artifacts/schema/org-locked-details.schema.json +17 -0
  14. package/artifacts/schema/org-plan-usage.schema.json +45 -0
  15. package/artifacts/schema/org-plan.schema.json +450 -0
  16. package/artifacts/schema/pending-plan-change.schema.json +112 -0
  17. package/artifacts/schema/plan-catalogue-entry.schema.json +226 -0
  18. package/artifacts/schema/plan-change-keep.schema.json +45 -0
  19. package/artifacts/schema/plan-change-reason.schema.json +10 -0
  20. package/artifacts/schema/plan-change-request.schema.json +71 -0
  21. package/artifacts/schema/plan-currency.schema.json +8 -0
  22. package/artifacts/schema/plan-features.schema.json +37 -0
  23. package/artifacts/schema/plan-id.schema.json +10 -0
  24. package/artifacts/schema/plan-limit-details.schema.json +87 -0
  25. package/artifacts/schema/plan-limits.schema.json +113 -0
  26. package/artifacts/schema/plan-overrides.schema.json +103 -0
  27. package/artifacts/schema/plan-prices.schema.json +33 -0
  28. package/artifacts/schema/plan-required-details.schema.json +42 -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 +94 -0
  33. package/dist/index.d.ts +6 -2
  34. package/dist/index.js +11 -1
  35. package/dist/plans.d.ts +525 -0
  36. package/dist/plans.js +442 -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 +58 -0
  41. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -9,6 +9,46 @@ 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 plan or a cancellation —
32
+ everything not named in `keep` (`planChangeKeep`) is deleted at
33
+ `period_ends_at`, never before — and `DELETE /api/org/plan/change` (Owner
34
+ tier) cancels one still pending.
35
+ - **The admin plan route.** `PATCH /api/admin/orgs/:id/plan`
36
+ (`adminPlanChangeRequest`) lets the operator change an org's plan,
37
+ add-ons, limit overrides (`planOverrides`), currency or billing period at
38
+ once, never queued. A new `RouteAuth` value, `ops`: a bearer token the
39
+ operator holds (`OPS_API_TOKEN`), reachable only on the cloud's private
40
+ address — every public host answers `404` for `/api/admin/*`.
41
+ - **The plan errors.** `409 plan_limit` (`planLimitDetails`, or
42
+ `assetPlanLimitDetails` for an asset-storage refusal), `403 plan_required`
43
+ (`planRequiredDetails`) and `403 org_locked` (`orgLockedDetails`), answered
44
+ before anything is written.
45
+ - **Two small additive changes that ride with the plan work.**
46
+ `liveSessionEndReason` gains `plan_limit`: a live session ended because the
47
+ org's monthly video limit was reached. `auditActor.kind` gains `fleetless`,
48
+ for an event the platform recorded with no member behind it — the admin
49
+ plan route, a queued change landing, a lock taking effect, the beta
50
+ switch.
51
+
12
52
  ## [6.0.0] — 2026-10-02
13
53
 
14
54
  ### Added