@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
@@ -9450,6 +9450,121 @@
9450
9450
  }
9451
9451
  }
9452
9452
  }
9453
+ },
9454
+ "/api/org/plan": {
9455
+ "get": {
9456
+ "operationId": "get_api_org_plan",
9457
+ "summary": "Reads the org's plan: its limits, its usage against them, its add-ons and any change already queued.",
9458
+ "tags": [
9459
+ "org"
9460
+ ],
9461
+ "security": [
9462
+ {
9463
+ "developerSession": []
9464
+ }
9465
+ ],
9466
+ "parameters": [],
9467
+ "responses": {
9468
+ "200": {
9469
+ "description": "Success.",
9470
+ "content": {
9471
+ "application/json": {
9472
+ "schema": {
9473
+ "$ref": "#/components/schemas/org-plan"
9474
+ }
9475
+ }
9476
+ }
9477
+ },
9478
+ "default": {
9479
+ "description": "An error envelope. Codes this route is known to answer: `unauthorized`, `token_expired`, `token_revoked`.",
9480
+ "content": {
9481
+ "application/json": {
9482
+ "schema": {
9483
+ "$ref": "#/components/schemas/api-error"
9484
+ }
9485
+ }
9486
+ }
9487
+ }
9488
+ },
9489
+ "description": "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."
9490
+ }
9491
+ },
9492
+ "/api/org/plan/change": {
9493
+ "put": {
9494
+ "operationId": "put_api_org_plan_change",
9495
+ "summary": "Moves the org's plan down — a lower plan or a cancellation to Basic — queuing the change rather than applying it at once.",
9496
+ "tags": [
9497
+ "org"
9498
+ ],
9499
+ "security": [
9500
+ {
9501
+ "developerSession": []
9502
+ }
9503
+ ],
9504
+ "parameters": [],
9505
+ "responses": {
9506
+ "200": {
9507
+ "description": "Success.",
9508
+ "content": {
9509
+ "application/json": {
9510
+ "schema": {
9511
+ "$ref": "#/components/schemas/org-plan"
9512
+ }
9513
+ }
9514
+ }
9515
+ },
9516
+ "default": {
9517
+ "description": "An error envelope. Codes this route is known to answer: `unauthorized`, `token_expired`, `token_revoked`, `tier_required`, `validation_error`, `plan_limit`, `target_state_conflict`.",
9518
+ "content": {
9519
+ "application/json": {
9520
+ "schema": {
9521
+ "$ref": "#/components/schemas/api-error"
9522
+ }
9523
+ }
9524
+ }
9525
+ }
9526
+ },
9527
+ "description": "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 — until payment exists, an upgrade or an add-on is not this route's job at all, and is handled today as a Feedback request that Fleetless then applies through the admin route. `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. A later `PUT` replaces a still-pending choice outright.",
9528
+ "requestBody": {
9529
+ "required": true,
9530
+ "content": {
9531
+ "application/json": {
9532
+ "schema": {
9533
+ "$ref": "#/components/schemas/plan-change-request"
9534
+ }
9535
+ }
9536
+ }
9537
+ }
9538
+ },
9539
+ "delete": {
9540
+ "operationId": "delete_api_org_plan_change",
9541
+ "summary": "Withdraws a plan change that was queued but has not taken effect yet.",
9542
+ "tags": [
9543
+ "org"
9544
+ ],
9545
+ "security": [
9546
+ {
9547
+ "developerSession": []
9548
+ }
9549
+ ],
9550
+ "parameters": [],
9551
+ "responses": {
9552
+ "204": {
9553
+ "description": "Success."
9554
+ },
9555
+ "default": {
9556
+ "description": "An error envelope. Codes this route is known to answer: `unauthorized`, `token_expired`, `token_revoked`, `tier_required`, `not_found`.",
9557
+ "content": {
9558
+ "application/json": {
9559
+ "schema": {
9560
+ "$ref": "#/components/schemas/api-error"
9561
+ }
9562
+ }
9563
+ }
9564
+ }
9565
+ },
9566
+ "description": "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; a developer who wants a different one sends a new `PUT`, which would have replaced this one outright anyway."
9567
+ }
9453
9568
  }
9454
9569
  },
9455
9570
  "components": {
@@ -11390,7 +11505,8 @@
11390
11505
  "end_user",
11391
11506
  "app_user",
11392
11507
  "server_key",
11393
- "bridge"
11508
+ "bridge",
11509
+ "fleetless"
11394
11510
  ]
11395
11511
  },
11396
11512
  "id": {
@@ -17837,6 +17953,455 @@
17837
17953
  ],
17838
17954
  "additionalProperties": false
17839
17955
  },
17956
+ "org-plan": {
17957
+ "type": "object",
17958
+ "properties": {
17959
+ "plan": {
17960
+ "type": "string",
17961
+ "enum": [
17962
+ "basic",
17963
+ "plus",
17964
+ "pro",
17965
+ "enterprise"
17966
+ ]
17967
+ },
17968
+ "currency": {
17969
+ "type": "string",
17970
+ "enum": [
17971
+ "eur",
17972
+ "usd"
17973
+ ]
17974
+ },
17975
+ "period_ends_at": {
17976
+ "type": "string",
17977
+ "format": "date-time",
17978
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
17979
+ "description": "The end of the organization's current billing period; while no payment period exists yet, the end of the current UTC calendar month. A pending downward plan change normally takes effect at this exact instant — except one chosen while the org was locked, which lands at once, and the platform's own move off the beta, which lands at its switch date instead."
17980
+ },
17981
+ "addons": {
17982
+ "type": "object",
17983
+ "properties": {
17984
+ "seats": {
17985
+ "type": "integer",
17986
+ "minimum": 0,
17987
+ "maximum": 9007199254740991
17988
+ },
17989
+ "robots": {
17990
+ "type": "integer",
17991
+ "minimum": 0,
17992
+ "maximum": 9007199254740991
17993
+ },
17994
+ "apps": {
17995
+ "type": "integer",
17996
+ "minimum": 0,
17997
+ "maximum": 9007199254740991
17998
+ },
17999
+ "app_user_packs": {
18000
+ "type": "integer",
18001
+ "minimum": 0,
18002
+ "maximum": 9007199254740991
18003
+ },
18004
+ "live_video_packs": {
18005
+ "type": "integer",
18006
+ "minimum": 0,
18007
+ "maximum": 9007199254740991
18008
+ }
18009
+ },
18010
+ "required": [
18011
+ "seats",
18012
+ "robots",
18013
+ "apps",
18014
+ "app_user_packs",
18015
+ "live_video_packs"
18016
+ ],
18017
+ "additionalProperties": false
18018
+ },
18019
+ "limits": {
18020
+ "type": "object",
18021
+ "properties": {
18022
+ "seats": {
18023
+ "anyOf": [
18024
+ {
18025
+ "type": "integer",
18026
+ "exclusiveMinimum": 0,
18027
+ "maximum": 9007199254740991
18028
+ },
18029
+ {
18030
+ "type": "null"
18031
+ }
18032
+ ]
18033
+ },
18034
+ "robots": {
18035
+ "anyOf": [
18036
+ {
18037
+ "type": "integer",
18038
+ "exclusiveMinimum": 0,
18039
+ "maximum": 9007199254740991
18040
+ },
18041
+ {
18042
+ "type": "null"
18043
+ }
18044
+ ]
18045
+ },
18046
+ "apps": {
18047
+ "anyOf": [
18048
+ {
18049
+ "type": "integer",
18050
+ "exclusiveMinimum": 0,
18051
+ "maximum": 9007199254740991
18052
+ },
18053
+ {
18054
+ "type": "null"
18055
+ }
18056
+ ]
18057
+ },
18058
+ "app_users": {
18059
+ "anyOf": [
18060
+ {
18061
+ "type": "integer",
18062
+ "exclusiveMinimum": 0,
18063
+ "maximum": 9007199254740991
18064
+ },
18065
+ {
18066
+ "type": "null"
18067
+ }
18068
+ ]
18069
+ },
18070
+ "live_video_ms_per_month": {
18071
+ "anyOf": [
18072
+ {
18073
+ "type": "integer",
18074
+ "exclusiveMinimum": 0,
18075
+ "maximum": 9007199254740991
18076
+ },
18077
+ {
18078
+ "type": "null"
18079
+ }
18080
+ ]
18081
+ },
18082
+ "asset_bytes_per_robot": {
18083
+ "anyOf": [
18084
+ {
18085
+ "type": "integer",
18086
+ "exclusiveMinimum": 0,
18087
+ "maximum": 9007199254740991
18088
+ },
18089
+ {
18090
+ "type": "null"
18091
+ }
18092
+ ]
18093
+ },
18094
+ "history_days": {
18095
+ "anyOf": [
18096
+ {
18097
+ "type": "integer",
18098
+ "exclusiveMinimum": 0,
18099
+ "maximum": 9007199254740991
18100
+ },
18101
+ {
18102
+ "type": "null"
18103
+ }
18104
+ ]
18105
+ },
18106
+ "audit_days": {
18107
+ "anyOf": [
18108
+ {
18109
+ "type": "integer",
18110
+ "exclusiveMinimum": 0,
18111
+ "maximum": 9007199254740991
18112
+ },
18113
+ {
18114
+ "type": "null"
18115
+ }
18116
+ ]
18117
+ }
18118
+ },
18119
+ "required": [
18120
+ "seats",
18121
+ "robots",
18122
+ "apps",
18123
+ "app_users",
18124
+ "live_video_ms_per_month",
18125
+ "asset_bytes_per_robot",
18126
+ "history_days",
18127
+ "audit_days"
18128
+ ],
18129
+ "additionalProperties": false
18130
+ },
18131
+ "features": {
18132
+ "type": "object",
18133
+ "properties": {
18134
+ "app_mcp": {
18135
+ "type": "boolean"
18136
+ },
18137
+ "two_factor": {
18138
+ "type": "boolean"
18139
+ },
18140
+ "require_two_factor": {
18141
+ "type": "boolean"
18142
+ },
18143
+ "app_oidc": {
18144
+ "type": "boolean"
18145
+ },
18146
+ "hosted_logo": {
18147
+ "type": "boolean"
18148
+ },
18149
+ "audit_export": {
18150
+ "type": "boolean"
18151
+ },
18152
+ "addons": {
18153
+ "type": "boolean"
18154
+ }
18155
+ },
18156
+ "required": [
18157
+ "app_mcp",
18158
+ "two_factor",
18159
+ "require_two_factor",
18160
+ "app_oidc",
18161
+ "hosted_logo",
18162
+ "audit_export",
18163
+ "addons"
18164
+ ],
18165
+ "additionalProperties": false
18166
+ },
18167
+ "usage": {
18168
+ "type": "object",
18169
+ "properties": {
18170
+ "seats": {
18171
+ "type": "integer",
18172
+ "minimum": 0,
18173
+ "maximum": 9007199254740991
18174
+ },
18175
+ "robots": {
18176
+ "type": "integer",
18177
+ "minimum": 0,
18178
+ "maximum": 9007199254740991
18179
+ },
18180
+ "apps": {
18181
+ "type": "integer",
18182
+ "minimum": 0,
18183
+ "maximum": 9007199254740991
18184
+ },
18185
+ "app_users": {
18186
+ "type": "integer",
18187
+ "minimum": 0,
18188
+ "maximum": 9007199254740991
18189
+ },
18190
+ "live_video_ms_this_month": {
18191
+ "type": "integer",
18192
+ "minimum": 0,
18193
+ "maximum": 9007199254740991
18194
+ },
18195
+ "asset_bytes": {
18196
+ "type": "integer",
18197
+ "minimum": 0,
18198
+ "maximum": 9007199254740991
18199
+ }
18200
+ },
18201
+ "required": [
18202
+ "seats",
18203
+ "robots",
18204
+ "apps",
18205
+ "app_users",
18206
+ "live_video_ms_this_month",
18207
+ "asset_bytes"
18208
+ ],
18209
+ "additionalProperties": false
18210
+ },
18211
+ "pending_change": {
18212
+ "anyOf": [
18213
+ {
18214
+ "type": "object",
18215
+ "properties": {
18216
+ "target_plan": {
18217
+ "type": "string",
18218
+ "enum": [
18219
+ "basic",
18220
+ "plus",
18221
+ "pro",
18222
+ "enterprise"
18223
+ ]
18224
+ },
18225
+ "reason": {
18226
+ "type": "string",
18227
+ "enum": [
18228
+ "downgrade",
18229
+ "cancel",
18230
+ "migration",
18231
+ "lock"
18232
+ ]
18233
+ },
18234
+ "effective_at": {
18235
+ "anyOf": [
18236
+ {
18237
+ "type": "string",
18238
+ "format": "date-time",
18239
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
18240
+ },
18241
+ {
18242
+ "type": "null"
18243
+ }
18244
+ ]
18245
+ },
18246
+ "keep": {
18247
+ "anyOf": [
18248
+ {
18249
+ "type": "object",
18250
+ "properties": {
18251
+ "robots": {
18252
+ "type": "array",
18253
+ "items": {
18254
+ "type": "string",
18255
+ "format": "uuid",
18256
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
18257
+ }
18258
+ },
18259
+ "apps": {
18260
+ "type": "array",
18261
+ "items": {
18262
+ "type": "string",
18263
+ "format": "uuid",
18264
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
18265
+ }
18266
+ },
18267
+ "app_users": {
18268
+ "type": "array",
18269
+ "items": {
18270
+ "type": "string",
18271
+ "format": "uuid",
18272
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
18273
+ }
18274
+ },
18275
+ "developers": {
18276
+ "type": "array",
18277
+ "items": {
18278
+ "type": "string",
18279
+ "format": "uuid",
18280
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
18281
+ }
18282
+ }
18283
+ },
18284
+ "required": [
18285
+ "robots",
18286
+ "apps",
18287
+ "app_users",
18288
+ "developers"
18289
+ ],
18290
+ "additionalProperties": false
18291
+ },
18292
+ {
18293
+ "type": "null"
18294
+ }
18295
+ ]
18296
+ },
18297
+ "history_days_after": {
18298
+ "type": "integer",
18299
+ "exclusiveMinimum": 0,
18300
+ "maximum": 9007199254740991
18301
+ },
18302
+ "chosen_by": {
18303
+ "type": "string",
18304
+ "format": "uuid",
18305
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
18306
+ },
18307
+ "chosen_at": {
18308
+ "type": "string",
18309
+ "format": "date-time",
18310
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
18311
+ }
18312
+ },
18313
+ "required": [
18314
+ "target_plan",
18315
+ "reason",
18316
+ "effective_at",
18317
+ "keep",
18318
+ "history_days_after",
18319
+ "chosen_by",
18320
+ "chosen_at"
18321
+ ],
18322
+ "additionalProperties": false
18323
+ },
18324
+ {
18325
+ "type": "null"
18326
+ }
18327
+ ]
18328
+ },
18329
+ "lock": {
18330
+ "anyOf": [
18331
+ {
18332
+ "type": "object",
18333
+ "properties": {
18334
+ "reason": {
18335
+ "type": "string",
18336
+ "enum": [
18337
+ "payment",
18338
+ "migration"
18339
+ ]
18340
+ },
18341
+ "since": {
18342
+ "type": "string",
18343
+ "format": "date-time",
18344
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
18345
+ }
18346
+ },
18347
+ "required": [
18348
+ "reason",
18349
+ "since"
18350
+ ],
18351
+ "additionalProperties": false
18352
+ },
18353
+ {
18354
+ "type": "null"
18355
+ }
18356
+ ]
18357
+ },
18358
+ "switch": {
18359
+ "anyOf": [
18360
+ {
18361
+ "type": "object",
18362
+ "properties": {
18363
+ "at": {
18364
+ "anyOf": [
18365
+ {
18366
+ "type": "string",
18367
+ "format": "date-time",
18368
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
18369
+ },
18370
+ {
18371
+ "type": "null"
18372
+ }
18373
+ ]
18374
+ },
18375
+ "needs_choice": {
18376
+ "type": "boolean"
18377
+ }
18378
+ },
18379
+ "required": [
18380
+ "at",
18381
+ "needs_choice"
18382
+ ],
18383
+ "additionalProperties": false
18384
+ },
18385
+ {
18386
+ "type": "null"
18387
+ }
18388
+ ]
18389
+ }
18390
+ },
18391
+ "required": [
18392
+ "plan",
18393
+ "currency",
18394
+ "period_ends_at",
18395
+ "addons",
18396
+ "limits",
18397
+ "features",
18398
+ "usage",
18399
+ "pending_change",
18400
+ "lock",
18401
+ "switch"
18402
+ ],
18403
+ "additionalProperties": false
18404
+ },
17840
18405
  "org-quota-usage": {
17841
18406
  "type": "object",
17842
18407
  "properties": {
@@ -18309,6 +18874,76 @@
18309
18874
  ],
18310
18875
  "additionalProperties": false
18311
18876
  },
18877
+ "plan-change-request": {
18878
+ "type": "object",
18879
+ "properties": {
18880
+ "target_plan": {
18881
+ "type": "string",
18882
+ "enum": [
18883
+ "basic",
18884
+ "plus",
18885
+ "pro",
18886
+ "enterprise"
18887
+ ]
18888
+ },
18889
+ "keep": {
18890
+ "anyOf": [
18891
+ {
18892
+ "type": "object",
18893
+ "properties": {
18894
+ "robots": {
18895
+ "type": "array",
18896
+ "items": {
18897
+ "type": "string",
18898
+ "format": "uuid",
18899
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
18900
+ }
18901
+ },
18902
+ "apps": {
18903
+ "type": "array",
18904
+ "items": {
18905
+ "type": "string",
18906
+ "format": "uuid",
18907
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
18908
+ }
18909
+ },
18910
+ "app_users": {
18911
+ "type": "array",
18912
+ "items": {
18913
+ "type": "string",
18914
+ "format": "uuid",
18915
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
18916
+ }
18917
+ },
18918
+ "developers": {
18919
+ "type": "array",
18920
+ "items": {
18921
+ "type": "string",
18922
+ "format": "uuid",
18923
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
18924
+ }
18925
+ }
18926
+ },
18927
+ "required": [
18928
+ "robots",
18929
+ "apps",
18930
+ "app_users",
18931
+ "developers"
18932
+ ],
18933
+ "additionalProperties": false
18934
+ },
18935
+ {
18936
+ "type": "null"
18937
+ }
18938
+ ]
18939
+ }
18940
+ },
18941
+ "required": [
18942
+ "target_plan",
18943
+ "keep"
18944
+ ],
18945
+ "additionalProperties": false
18946
+ },
18312
18947
  "protected-resource-metadata": {
18313
18948
  "type": "object",
18314
18949
  "properties": {