@fleetless/contracts 9.2.0-next.1 → 10.0.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.
- package/CHANGELOG.md +19 -4
- package/artifacts/openapi.json +16927 -8920
- package/artifacts/routes.json +96 -54
- package/artifacts/schema/billing-change-response.schema.json +1527 -1727
- package/artifacts/schema/billing-decision-amounts.schema.json +244 -0
- package/artifacts/schema/billing-decision-display-request.schema.json +24 -0
- package/artifacts/schema/billing-decision-display-response.schema.json +3130 -0
- package/artifacts/schema/billing-decision-period.schema.json +550 -0
- package/artifacts/schema/billing-decision-snapshot.schema.json +3103 -0
- package/artifacts/schema/bridge-state.schema.json +0 -14
- package/artifacts/schema/checkout-request.schema.json +3 -4
- package/artifacts/schema/checkout-response.schema.json +492 -402
- package/artifacts/schema/client-robot-list-item.schema.json +0 -14
- package/artifacts/schema/client-robot-list-response.schema.json +0 -14
- package/artifacts/schema/confirmation-proof.schema.json +6 -0
- package/artifacts/schema/plan-change-decision-lookup-query.schema.json +16 -0
- package/artifacts/schema/plan-change-decision-status-response.schema.json +543 -0
- package/artifacts/schema/plan-change-prepare-request.schema.json +84 -0
- package/artifacts/schema/plan-change-prepare-response.schema.json +3162 -0
- package/artifacts/schema/plan-change-request.schema.json +177 -65
- package/artifacts/schema/purchase-conflict-details.schema.json +94 -0
- package/artifacts/schema/purchase-intent-accepted-without-payment.schema.json +95 -0
- package/artifacts/schema/purchase-intent-confirm-request.schema.json +146 -33
- package/artifacts/schema/purchase-intent-draft.schema.json +449 -0
- package/artifacts/schema/purchase-intent-payment-started.schema.json +184 -0
- package/artifacts/schema/purchase-intent-response.schema.json +1235 -168
- package/artifacts/schema/robot-detail-response.schema.json +0 -14
- package/artifacts/schema/robot-list-item.schema.json +0 -14
- package/artifacts/schema/robot-list-response.schema.json +0 -14
- package/dist/billing.d.ts +5665 -210
- package/dist/billing.js +224 -29
- package/dist/client-robots.d.ts +0 -6
- package/dist/confirmation-proof.d.ts +5 -0
- package/dist/confirmation-proof.js +6 -0
- package/dist/errors.d.ts +1 -1
- package/dist/errors.js +0 -12
- package/dist/iana-time-zones.d.ts +2 -0
- package/dist/iana-time-zones.js +426 -0
- package/dist/index.d.ts +7 -6
- package/dist/index.js +4 -3
- package/dist/plans.d.ts +125 -1
- package/dist/plans.js +19 -1
- package/dist/protocol.d.ts +0 -3
- package/dist/protocol.js +0 -1
- package/dist/purchase-operation-key.d.ts +4 -0
- package/dist/purchase-operation-key.js +4 -0
- package/dist/rest.d.ts +0 -52
- package/dist/rest.js +0 -15
- package/dist/routes.js +43 -35
- package/package.json +3 -1
- package/artifacts/schema/recover-held-job-request.schema.json +0 -29
- package/artifacts/schema/recover-held-job-response.schema.json +0 -125
package/artifacts/routes.json
CHANGED
|
@@ -5848,44 +5848,6 @@
|
|
|
5848
5848
|
"transport": "http",
|
|
5849
5849
|
"notes": "The body is optional: a bodyless `POST` was every caller's shape before `job_id` existed, and absent or `job_id: null` both mean \"cancel whatever is running\". A named `job_id` that is **not** what is running cancels nothing and answers `404` — the caller named an id and thereby ruled the other one out. An `external` job is cancelled the same way, through its goal id. Cancelling an `unknown` job also cancels every external goal on its action, since one of them may be that job. A service is `422 not_cancellable`: a service call has no goal to cancel. Nothing running is a `200` with `job: null`. The answer waits for the bridge's `cancel_result`: a `200` means the action server accepted the cancel request, not that the goal has ended — the job's end arrives as its own update. Any goal answered `ERROR_REJECTED` makes it `409 cancel_rejected`, with every goal and its `return_code` in `details.goals`; no answer within `JOB_HEARTBEAT_TIMEOUT_MS` is `504 bridge_timeout`; a cancel the bridge could not send at all is `502` carrying the bridge's own code (`unknown_slug`, `action_server_lost`, `internal_error`)."
|
|
5850
5850
|
},
|
|
5851
|
-
{
|
|
5852
|
-
"method": "POST",
|
|
5853
|
-
"path": "/api/robots/:id/jobs/:slug/recover",
|
|
5854
|
-
"section": "commands",
|
|
5855
|
-
"summary": "Releases one held job after an Owner verifies the robot is stopped.",
|
|
5856
|
-
"audience": "developer",
|
|
5857
|
-
"auth": "developer",
|
|
5858
|
-
"rateLimited": false,
|
|
5859
|
-
"ownerTier": true,
|
|
5860
|
-
"status": 200,
|
|
5861
|
-
"params": [
|
|
5862
|
-
{
|
|
5863
|
-
"name": "id",
|
|
5864
|
-
"description": "The robot uuid in the authenticated Owner's organization."
|
|
5865
|
-
},
|
|
5866
|
-
{
|
|
5867
|
-
"name": "slug",
|
|
5868
|
-
"description": "The action slug holding the exact job named in the body."
|
|
5869
|
-
}
|
|
5870
|
-
],
|
|
5871
|
-
"query": null,
|
|
5872
|
-
"request": "recover-held-job-request",
|
|
5873
|
-
"response": "recover-held-job-response",
|
|
5874
|
-
"errors": [
|
|
5875
|
-
"unauthorized",
|
|
5876
|
-
"token_expired",
|
|
5877
|
-
"token_revoked",
|
|
5878
|
-
"tier_required",
|
|
5879
|
-
"support_forbidden",
|
|
5880
|
-
"invalid_uuid",
|
|
5881
|
-
"not_found",
|
|
5882
|
-
"validation_error",
|
|
5883
|
-
"job_state_conflict",
|
|
5884
|
-
"internal_error"
|
|
5885
|
-
],
|
|
5886
|
-
"transport": "http",
|
|
5887
|
-
"notes": "Use only after physically stopping or isolating the robot and checking that it cannot move. Read the held job id, then submit that exact id with a reason and `verified_stopped: true`. The assertion is a human safety check, not a sensor reading. The cloud records the Owner and reason in the audit trail and returns the job settled to `lost`. App users, server keys, other developers and support sessions cannot use this route. A connected bridge or a changed job returns `409 job_state_conflict`; a normal cancel is not recovery and never releases an uncertain job."
|
|
5888
|
-
},
|
|
5889
5851
|
{
|
|
5890
5852
|
"method": "POST",
|
|
5891
5853
|
"path": "/api/robots/:id/publishers/:slug",
|
|
@@ -6596,11 +6558,37 @@
|
|
|
6596
6558
|
"transport": "http",
|
|
6597
6559
|
"notes": "The one read the console's Plan & billing page, its usage and limit gauges, and every upgrade prompt and feature gate draw from — nothing else computes `limits` or `usage` on its own. `limits` is already the effective ceiling, the catalogue row raised by `addons` or replaced by an operator's override, so a consumer never recomputes it from the catalogue. `usage` is counted fresh on every call, never cached. `switch` is present only for an organization still on the beta that has not yet landed on a priced plan."
|
|
6598
6560
|
},
|
|
6561
|
+
{
|
|
6562
|
+
"method": "POST",
|
|
6563
|
+
"path": "/api/org/plan/change/prepare",
|
|
6564
|
+
"section": "org",
|
|
6565
|
+
"summary": "Prepares a nonbinding downward-plan decision and its C.4 display.",
|
|
6566
|
+
"audience": "developer",
|
|
6567
|
+
"auth": "developer",
|
|
6568
|
+
"rateLimited": false,
|
|
6569
|
+
"ownerTier": true,
|
|
6570
|
+
"status": 200,
|
|
6571
|
+
"params": [],
|
|
6572
|
+
"query": null,
|
|
6573
|
+
"request": "plan-change-prepare-request",
|
|
6574
|
+
"response": "plan-change-prepare-response",
|
|
6575
|
+
"errors": [
|
|
6576
|
+
"unauthorized",
|
|
6577
|
+
"token_expired",
|
|
6578
|
+
"token_revoked",
|
|
6579
|
+
"tier_required",
|
|
6580
|
+
"validation_error",
|
|
6581
|
+
"plan_limit",
|
|
6582
|
+
"target_state_conflict"
|
|
6583
|
+
],
|
|
6584
|
+
"transport": "http",
|
|
6585
|
+
"notes": "Owner only. Persists a prepared change reference and a short-lived display, without mutating the plan, pending_change, or legal acceptance. A same-key, same-input retry while undecided returns the same change_id with a fresh display. A Basic cancellation reason belongs only in the final PUT."
|
|
6586
|
+
},
|
|
6599
6587
|
{
|
|
6600
6588
|
"method": "PUT",
|
|
6601
6589
|
"path": "/api/org/plan/change",
|
|
6602
6590
|
"section": "org",
|
|
6603
|
-
"summary": "
|
|
6591
|
+
"summary": "Confirms a prepared downward-plan decision with its C.4 proof.",
|
|
6604
6592
|
"audience": "developer",
|
|
6605
6593
|
"auth": "developer",
|
|
6606
6594
|
"rateLimited": false,
|
|
@@ -6620,7 +6608,32 @@
|
|
|
6620
6608
|
"target_state_conflict"
|
|
6621
6609
|
],
|
|
6622
6610
|
"transport": "http",
|
|
6623
|
-
"notes": "Owner tier, and **downward only**: this route moves the org to a lower plan or cancels it outright to Basic. It never moves the org up — an upgrade or an add-on goes through the billing routes instead (`POST /api/billing/checkout`, `POST /api/billing/change`). `409 target_state_conflict` names `target_plan` with rule `not_lower` when the chosen plan is not below the org's current one; with rule `locked_basic_only` when the org is locked (`orgLock`) and the chosen plan is anything but Basic; and with rule `migration_basic_only` when the org is still on the beta, awaiting the switch to priced plans, and the chosen plan is anything but Basic — that choice is exactly what the org lands on at the switch. An owner is never named in `keep` and always stays, but still counts against the target plan's `seats`; `409 plan_limit` names `seats` when the owners alone already exceed it, and names whichever other limit `keep` still exceeds otherwise. `keep` is `null` when the org's current usage already fits the target plan outright and nothing is deleted; named, it lists exactly the robots, apps, app users and developers that stay. The choice is stored as `pending_change` and takes effect at `period_ends_at` — **everything of the chosen kind not named in `keep` is deleted at that instant, never before** — except a choice made while the org is locked, which takes effect at once, and a beta org's choice, which takes effect at the switch date instead. Anything created while the choice is pending is checked against the target plan too and, when it passes, is folded into `keep`, so exactly what the confirmation counted is what is actually deleted.
|
|
6611
|
+
"notes": "Owner tier, and **downward only**: a prior prepare returns change_id and a displayed snapshot; this final PUT requires its confirmation_proof and the same operation_key, target_plan and keep. Only Basic permits cancellation_reason (at most 500 input characters). The reason is final idempotency metadata, not price or legal evidence. An exact replay returns the original result; a changed reason with the same key conflicts before effect. The decision and legal acceptance commit together. This route moves the org to a lower plan or cancels it outright to Basic. It never moves the org up — an upgrade or an add-on goes through the billing routes instead (`POST /api/billing/checkout`, `POST /api/billing/change`). `409 target_state_conflict` names `target_plan` with rule `not_lower` when the chosen plan is not below the org's current one; with rule `locked_basic_only` when the org is locked (`orgLock`) and the chosen plan is anything but Basic; and with rule `migration_basic_only` when the org is still on the beta, awaiting the switch to priced plans, and the chosen plan is anything but Basic — that choice is exactly what the org lands on at the switch. An owner is never named in `keep` and always stays, but still counts against the target plan's `seats`; `409 plan_limit` names `seats` when the owners alone already exceed it, and names whichever other limit `keep` still exceeds otherwise. `keep` is `null` when the org's current usage already fits the target plan outright and nothing is deleted; named, it lists exactly the robots, apps, app users and developers that stay. The choice is stored as `pending_change` and takes effect at `period_ends_at` — **everything of the chosen kind not named in `keep` is deleted at that instant, never before** — except a choice made while the org is locked, which takes effect at once, and a beta org's choice, which takes effect at the switch date instead. Anything created while the choice is pending is checked against the target plan too and, when it passes, is folded into `keep`, so exactly what the confirmation counted is what is actually deleted. Replacing a still-pending choice requires a new prepare and proof-bound final PUT."
|
|
6612
|
+
},
|
|
6613
|
+
{
|
|
6614
|
+
"method": "GET",
|
|
6615
|
+
"path": "/api/org/plan/change/decisions",
|
|
6616
|
+
"section": "org",
|
|
6617
|
+
"summary": "Looks up the prepared or accepted owner plan decision by operation key.",
|
|
6618
|
+
"audience": "developer",
|
|
6619
|
+
"auth": "developer",
|
|
6620
|
+
"rateLimited": false,
|
|
6621
|
+
"ownerTier": true,
|
|
6622
|
+
"status": 200,
|
|
6623
|
+
"params": [],
|
|
6624
|
+
"query": "plan-change-decision-lookup-query",
|
|
6625
|
+
"request": null,
|
|
6626
|
+
"response": "plan-change-decision-status-response",
|
|
6627
|
+
"errors": [
|
|
6628
|
+
"unauthorized",
|
|
6629
|
+
"token_expired",
|
|
6630
|
+
"token_revoked",
|
|
6631
|
+
"tier_required",
|
|
6632
|
+
"validation_error",
|
|
6633
|
+
"not_found"
|
|
6634
|
+
],
|
|
6635
|
+
"transport": "http",
|
|
6636
|
+
"notes": "Scope the operation key to the authenticated real Owner and organization. An unknown or foreign key returns 404 without disclosure. Prepared returns only change_id; accepted returns the stored original orgPlan result. No proof is returned. Console checks this before asking for a fresh display after a lost final response."
|
|
6624
6637
|
},
|
|
6625
6638
|
{
|
|
6626
6639
|
"method": "DELETE",
|
|
@@ -6644,7 +6657,7 @@
|
|
|
6644
6657
|
"not_found"
|
|
6645
6658
|
],
|
|
6646
6659
|
"transport": "http",
|
|
6647
|
-
"notes": "Owner tier. `404 not_found` when the org has no `pending_change` to withdraw. The org stays on its current plan, unchanged, as if the choice had never been made;
|
|
6660
|
+
"notes": "Owner tier. `404 not_found` when the org has no `pending_change` to withdraw. The org stays on its current plan, unchanged, as if the choice had never been made; an Owner who wants a different one prepares a new display and confirms it with a final PUT."
|
|
6648
6661
|
},
|
|
6649
6662
|
{
|
|
6650
6663
|
"method": "PATCH",
|
|
@@ -6697,7 +6710,7 @@
|
|
|
6697
6710
|
"tier_required"
|
|
6698
6711
|
],
|
|
6699
6712
|
"transport": "http",
|
|
6700
|
-
"notes": "`available: false` when `MOLLIE_API_KEY` is not configured — this cloud takes no payments, and every billing route that charges or opens a Mollie checkout answers `503 billing_unavailable` instead of acting;
|
|
6713
|
+
"notes": "`available: false` when `MOLLIE_API_KEY` is not configured — this cloud takes no payments, and every billing route that charges or opens a Mollie checkout answers `503 billing_unavailable` instead of acting; plan-change prepare, resume, the details and the VAT-ID check need no Mollie and answer normally. `account` is `null` before the org has ever checked out; the plan and its limits still come from `GET /api/org/plan` (fleetless/fleetless issue 103) and are not repeated here."
|
|
6701
6714
|
},
|
|
6702
6715
|
{
|
|
6703
6716
|
"method": "POST",
|
|
@@ -6726,7 +6739,7 @@
|
|
|
6726
6739
|
"payment_provider_unavailable"
|
|
6727
6740
|
],
|
|
6728
6741
|
"transport": "http",
|
|
6729
|
-
"notes": "Basic stays free for every payer.
|
|
6742
|
+
"notes": "Basic stays free for every payer. This start creates only a nonbinding draft; accept_terms is deprecated and cannot confirm an order. Current company, buyer, VIES and EUR quote checks still apply. Persist operation_key before POST; same key/input recovers the intent, changed input conflicts. An eligible Owner obtains a no-store C.4 display, then explicitly confirms with its proof. No payment or acceptance occurs at start. Hosted payment later offers card, PayPal or Apple Pay; its return is <console>/settings/billing?checkout=<checkout_id>. An active/past_due account uses billing/change."
|
|
6730
6743
|
},
|
|
6731
6744
|
{
|
|
6732
6745
|
"method": "GET",
|
|
@@ -6751,7 +6764,38 @@
|
|
|
6751
6764
|
"not_found"
|
|
6752
6765
|
],
|
|
6753
6766
|
"transport": "http",
|
|
6754
|
-
"notes": "Supply exactly one of operation_key or intent_id and the expected operation. Scope lookup to the authenticated owner and org; unknown, foreign-org or mismatched-operation intents return 404 without disclosure. Repeating a lookup after restart or lost response returns the same intent/payment identity and, for a paid change, its billing result.
|
|
6767
|
+
"notes": "Supply exactly one of operation_key or intent_id and the expected operation. Scope lookup to the authenticated owner and org; unknown, foreign-org or mismatched-operation intents return 404 without disclosure. Repeating a lookup after restart or lost response returns the same intent/payment identity and, for a paid change, its billing result. A proof is never returned here; a still-eligible decision needs a fresh C.4 display and explicit Owner click."
|
|
6768
|
+
},
|
|
6769
|
+
{
|
|
6770
|
+
"method": "POST",
|
|
6771
|
+
"path": "/api/billing/intents/:id/display",
|
|
6772
|
+
"section": "billing",
|
|
6773
|
+
"summary": "Issues a short-lived C.4 decision display and opaque confirmation proof.",
|
|
6774
|
+
"audience": "developer",
|
|
6775
|
+
"auth": "developer",
|
|
6776
|
+
"rateLimited": false,
|
|
6777
|
+
"ownerTier": true,
|
|
6778
|
+
"status": 200,
|
|
6779
|
+
"params": [
|
|
6780
|
+
{
|
|
6781
|
+
"name": "id",
|
|
6782
|
+
"description": "The eligible intent ID returned by checkout or billing change."
|
|
6783
|
+
}
|
|
6784
|
+
],
|
|
6785
|
+
"query": null,
|
|
6786
|
+
"request": "billing-decision-display-request",
|
|
6787
|
+
"response": "billing-decision-display-response",
|
|
6788
|
+
"errors": [
|
|
6789
|
+
"unauthorized",
|
|
6790
|
+
"token_expired",
|
|
6791
|
+
"token_revoked",
|
|
6792
|
+
"tier_required",
|
|
6793
|
+
"validation_error",
|
|
6794
|
+
"not_found",
|
|
6795
|
+
"target_state_conflict"
|
|
6796
|
+
],
|
|
6797
|
+
"transport": "http",
|
|
6798
|
+
"notes": "Owner only, Cache-Control: no-store. Cloud persists the snapshot and proof hash for an eligible current checkout or paid-change intent of this Owner and org. Pending, held, refused or accepted intents cannot mint a new proof. The proof never appears in lookup, billing views or logs."
|
|
6755
6799
|
},
|
|
6756
6800
|
{
|
|
6757
6801
|
"method": "POST",
|
|
@@ -6786,7 +6830,7 @@
|
|
|
6786
6830
|
"payment_provider_unavailable"
|
|
6787
6831
|
],
|
|
6788
6832
|
"transport": "http",
|
|
6789
|
-
"notes": "
|
|
6833
|
+
"notes": "Checkout and paid-change decisions require confirmation_proof along with the operation key, quote revision and buyer fingerprint shown in the persisted C.4 display. Cloud rechecks buyer, quote, selection, legal references, period and current state under the org lock; stale or spent proof conflicts without effect. One decision and one legal acceptance commit together. An exact same-key replay returns the original result without another payment or acceptance. Foreign ownership answers 404 without disclosure; pending or held cannot charge."
|
|
6790
6834
|
},
|
|
6791
6835
|
{
|
|
6792
6836
|
"method": "GET",
|
|
@@ -6871,7 +6915,7 @@
|
|
|
6871
6915
|
"method": "POST",
|
|
6872
6916
|
"path": "/api/billing/change",
|
|
6873
6917
|
"section": "billing",
|
|
6874
|
-
"summary": "Records a paid-change intent or
|
|
6918
|
+
"summary": "Records a nonbinding paid-change intent for a plan, cycle or add-on target.",
|
|
6875
6919
|
"audience": "developer",
|
|
6876
6920
|
"auth": "developer",
|
|
6877
6921
|
"rateLimited": false,
|
|
@@ -6893,7 +6937,7 @@
|
|
|
6893
6937
|
"payment_provider_unavailable"
|
|
6894
6938
|
],
|
|
6895
6939
|
"transport": "http",
|
|
6896
|
-
"notes": "The request names an absolute plan/cycle/add-on target and a stable operation_key.
|
|
6940
|
+
"notes": "The request names an absolute plan/cycle/add-on target and a stable operation_key. Start is nonbinding for every change, including zero-charge, scheduled and formerly immediate decreases: it neither changes the plan nor writes legal acceptance. An eligible Owner obtains a C.4 display and explicitly confirms with its proof. Confirmation may return accepted_no_payment with charged: null and no provider payment or redirect, or payment_started for a charged change. Exact-key lookup recovers the accepted result. Existing no_account, past_due, no_valid_mandate and plan_limit conflicts remain."
|
|
6897
6941
|
},
|
|
6898
6942
|
{
|
|
6899
6943
|
"method": "POST",
|
|
@@ -6928,28 +6972,26 @@
|
|
|
6928
6972
|
"method": "POST",
|
|
6929
6973
|
"path": "/api/billing/cancel",
|
|
6930
6974
|
"section": "billing",
|
|
6931
|
-
"summary": "
|
|
6975
|
+
"summary": "Rejects legacy direct cancellation after the C.4 gate is active.",
|
|
6932
6976
|
"audience": "developer",
|
|
6933
6977
|
"auth": "developer",
|
|
6934
6978
|
"rateLimited": false,
|
|
6935
6979
|
"ownerTier": true,
|
|
6936
|
-
"status":
|
|
6980
|
+
"status": 409,
|
|
6937
6981
|
"params": [],
|
|
6938
6982
|
"query": null,
|
|
6939
6983
|
"request": "billing-cancel-request",
|
|
6940
6984
|
"requestOptional": true,
|
|
6941
|
-
"response":
|
|
6985
|
+
"response": null,
|
|
6942
6986
|
"errors": [
|
|
6943
6987
|
"unauthorized",
|
|
6944
6988
|
"token_expired",
|
|
6945
6989
|
"token_revoked",
|
|
6946
6990
|
"tier_required",
|
|
6947
|
-
"
|
|
6948
|
-
"not_found",
|
|
6949
|
-
"plan_limit"
|
|
6991
|
+
"target_state_conflict"
|
|
6950
6992
|
],
|
|
6951
6993
|
"transport": "http",
|
|
6952
|
-
"notes": "
|
|
6994
|
+
"notes": "The C.4 gate rejects this legacy POST with 409 target_state_conflict before mutation, audit or mail. Console uses POST /api/org/plan/change/prepare and the proof-bound final PUT for Basic, including an optional reason there. This route cannot confirm a customer decision."
|
|
6953
6995
|
},
|
|
6954
6996
|
{
|
|
6955
6997
|
"method": "POST",
|