@fleetless/contracts 13.2.0 → 14.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.
Files changed (100) hide show
  1. package/CHANGELOG.md +169 -0
  2. package/artifacts/openapi.json +2092 -787
  3. package/artifacts/routes.json +229 -230
  4. package/artifacts/schema/access-warning.schema.json +51 -0
  5. package/artifacts/schema/action-config.schema.json +35 -0
  6. package/artifacts/schema/app-access-response.schema.json +136 -0
  7. package/artifacts/schema/app-access.schema.json +80 -0
  8. package/artifacts/schema/app-auth-config.schema.json +15 -0
  9. package/artifacts/schema/app-deletion-summary.schema.json +0 -7
  10. package/artifacts/schema/app-invitation-list-response.schema.json +13 -6
  11. package/artifacts/schema/app-invitation.schema.json +5 -5
  12. package/artifacts/schema/app-list-response.schema.json +6 -6
  13. package/artifacts/schema/app-lock.schema.json +30 -0
  14. package/artifacts/schema/app-user-list-response.schema.json +13 -6
  15. package/artifacts/schema/app-user.schema.json +13 -6
  16. package/artifacts/schema/app.schema.json +6 -6
  17. package/artifacts/schema/auth-ok.schema.json +20 -6
  18. package/artifacts/schema/camera-list-response.schema.json +1 -1
  19. package/artifacts/schema/client-identity.schema.json +21 -6
  20. package/artifacts/schema/cloud-config.schema.json +359 -5
  21. package/artifacts/schema/config-draft-response.schema.json +389 -5
  22. package/artifacts/schema/config-version-response.schema.json +389 -5
  23. package/artifacts/schema/config-versions-response.schema.json +30 -0
  24. package/artifacts/schema/create-app-invitation-request.schema.json +4 -4
  25. package/artifacts/schema/create-app-user-request.schema.json +4 -4
  26. package/artifacts/schema/create-org-role-request.schema.json +33 -0
  27. package/artifacts/schema/dangling-reference.schema.json +129 -0
  28. package/artifacts/schema/datapoint-config.schema.json +35 -0
  29. package/artifacts/schema/datapoint-list-response.schema.json +1 -1
  30. package/artifacts/schema/effective-capability.schema.json +104 -0
  31. package/artifacts/schema/effective-rights-query.schema.json +19 -0
  32. package/artifacts/schema/effective-rights-response.schema.json +310 -0
  33. package/artifacts/schema/effective-robot-rights.schema.json +266 -0
  34. package/artifacts/schema/invoke-or-service-response.schema.json +1 -1
  35. package/artifacts/schema/invoke-response.schema.json +1 -1
  36. package/artifacts/schema/journal-intent-v2-body.schema.json +74 -0
  37. package/artifacts/schema/journal-intent-v2.schema.json +84 -0
  38. package/artifacts/schema/journal-replay-receipt-body.schema.json +1 -0
  39. package/artifacts/schema/journal-replay-receipt.schema.json +1 -0
  40. package/artifacts/schema/mcp-robot-datasheet.schema.json +2 -2
  41. package/artifacts/schema/org-role-list-response.schema.json +205 -0
  42. package/artifacts/schema/org-role.schema.json +59 -0
  43. package/artifacts/schema/patch-app-user-request.schema.json +4 -4
  44. package/artifacts/schema/patch-org-role-request.schema.json +38 -0
  45. package/artifacts/schema/publish-config-response.schema.json +48 -1
  46. package/artifacts/schema/publisher-config.schema.json +35 -0
  47. package/artifacts/schema/put-role-defaults-request.schema.json +127 -0
  48. package/artifacts/schema/reference-place.schema.json +111 -0
  49. package/artifacts/schema/rename-slug-response.schema.json +4 -3
  50. package/artifacts/schema/robot-config-doc.schema.json +359 -5
  51. package/artifacts/schema/role-cycle-details.schema.json +18 -0
  52. package/artifacts/schema/role-defaults-response.schema.json +59 -0
  53. package/artifacts/schema/role-rename-preview.schema.json +146 -0
  54. package/artifacts/schema/service-config.schema.json +35 -0
  55. package/artifacts/schema/slug-usage-response.schema.json +4 -3
  56. package/artifacts/schema/update-app-request.schema.json +0 -12
  57. package/dist/app-users.d.ts +30 -10
  58. package/dist/app-users.js +32 -12
  59. package/dist/apps.d.ts +242 -71
  60. package/dist/apps.js +205 -151
  61. package/dist/audit.d.ts +3 -3
  62. package/dist/billing.d.ts +10 -10
  63. package/dist/client-auth.d.ts +5 -2
  64. package/dist/client-auth.js +11 -3
  65. package/dist/client-robots.d.ts +1 -1
  66. package/dist/client-robots.js +1 -1
  67. package/dist/common.d.ts +1 -1
  68. package/dist/common.js +1 -1
  69. package/dist/config-issues.d.ts +1 -1
  70. package/dist/config-issues.js +1 -1
  71. package/dist/config.d.ts +77 -11
  72. package/dist/config.js +108 -14
  73. package/dist/errors.d.ts +14 -5
  74. package/dist/errors.js +37 -24
  75. package/dist/index.d.ts +22 -12
  76. package/dist/index.js +16 -6
  77. package/dist/journal-intents.d.ts +30 -0
  78. package/dist/journal-intents.js +3 -0
  79. package/dist/legal-acceptances.d.ts +2 -2
  80. package/dist/mcp.d.ts +5 -37
  81. package/dist/mcp.js +4 -14
  82. package/dist/org-roles.d.ts +182 -0
  83. package/dist/org-roles.js +198 -0
  84. package/dist/plans.d.ts +6 -6
  85. package/dist/protocol.d.ts +19 -1
  86. package/dist/realtime.d.ts +6 -3
  87. package/dist/realtime.js +1 -1
  88. package/dist/rest.d.ts +104 -25
  89. package/dist/rest.js +67 -29
  90. package/dist/rights.d.ts +197 -0
  91. package/dist/rights.js +396 -0
  92. package/dist/routes.js +190 -148
  93. package/package.json +1 -1
  94. package/artifacts/schema/mcp-role-preview-response.schema.json +0 -134
  95. package/artifacts/schema/role-delete-query.schema.json +0 -13
  96. package/artifacts/schema/role-in-use-details.schema.json +0 -28
  97. package/artifacts/schema/role-list-response.schema.json +0 -48
  98. package/artifacts/schema/role-permissions.schema.json +0 -61
  99. package/artifacts/schema/role-rename-request.schema.json +0 -16
  100. package/artifacts/schema/role.schema.json +0 -35
@@ -12,6 +12,36 @@
12
12
  "format": "date-time",
13
13
  "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))$"
14
14
  },
15
+ "published_by": {
16
+ "description": "Who published the version. `null` when the member has since been removed, or when the version is older than this field. Absent when the server predates this field: read an absent field as unknown, the same as `null`. The cloud always sends it.",
17
+ "anyOf": [
18
+ {
19
+ "type": "object",
20
+ "properties": {
21
+ "id": {
22
+ "type": "string",
23
+ "format": "uuid",
24
+ "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)$",
25
+ "description": "The team member's id."
26
+ },
27
+ "name": {
28
+ "type": "string",
29
+ "minLength": 1,
30
+ "maxLength": 200,
31
+ "description": "The member's display name, or the local part of the email address when the member has none. Never a full email address."
32
+ }
33
+ },
34
+ "required": [
35
+ "id",
36
+ "name"
37
+ ],
38
+ "additionalProperties": false
39
+ },
40
+ {
41
+ "type": "null"
42
+ }
43
+ ]
44
+ },
15
45
  "doc": {
16
46
  "type": "object",
17
47
  "properties": {
@@ -399,6 +429,41 @@
399
429
  }
400
430
  }
401
431
  ]
432
+ },
433
+ "role": {
434
+ "anyOf": [
435
+ {
436
+ "type": "string",
437
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$",
438
+ "patternErrorMessage": "A role key is lower-case: it starts with a letter and continues with letters, digits and underscores, up to 63 characters in all — `operate`, `night_shift`. A capital, a dash, a dot, a space or a leading digit is refused, and `defaults` is reserved."
439
+ },
440
+ {
441
+ "minItems": 1,
442
+ "maxItems": 50,
443
+ "type": "array",
444
+ "items": {
445
+ "type": "string",
446
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$",
447
+ "patternErrorMessage": "A role key is lower-case: it starts with a letter and continues with letters, digits and underscores, up to 63 characters in all — `operate`, `night_shift`. A capital, a dash, a dot, a space or a leading digit is refused, and `defaults` is reserved."
448
+ }
449
+ }
450
+ ],
451
+ "defaultSnippets": [
452
+ {
453
+ "label": "one role",
454
+ "description": "The role that may use this; a role that inherits from it may too.",
455
+ "body": "${1:operate}"
456
+ },
457
+ {
458
+ "label": "any of several roles",
459
+ "description": "A list of roles; holding one of them, or inheriting from one, is enough.",
460
+ "body": [
461
+ "${1:operate}",
462
+ "${2:admin}"
463
+ ]
464
+ }
465
+ ],
466
+ "description": "Which role may read this datapoint: one role key, or a list of keys when several roles qualify. A role qualifies when it, or a role it inherits from, is named. Without this, the first rule of `access.rules` that fits the entry decides, and without a fitting rule the organization's default for `read` applies. A key that names no role of the organization is a warning when you publish, never an error, and grants nothing. The robot ignores it; the cloud enforces it."
402
467
  }
403
468
  },
404
469
  "required": [
@@ -443,7 +508,7 @@
443
508
  }
444
509
  ]
445
510
  },
446
- "description": "Values the robot publishes, each one field of one topic or a whole topic, and **never several topics**. Keys are slugs, one namespace across all five exposure sections, which is what lets a role grant say `{robot, slug}` without naming a kind; `bridge_state` and `robot_details` are built-in, and `history` is reserved because `GET …/jobs/history` would shadow an action of that name; all three are refused when the document is validated.",
511
+ "description": "Values the robot publishes, each one field of one topic or a whole topic, and **never several topics**. Keys are slugs, one namespace across all five exposure sections, which is what lets an app lock name `{robot, slug}` without naming a kind; `bridge_state` and `robot_details` are built-in, `history` is reserved because `GET …/jobs/history` would shadow an action of that name, and `assets` and `job_history` are reserved because they name the robot-level capabilities; all five are refused when the document is validated.",
447
512
  "defaultSnippets": [
448
513
  {
449
514
  "label": "a datapoint",
@@ -672,6 +737,41 @@
672
737
  "type": "string",
673
738
  "minLength": 1,
674
739
  "maxLength": 2000
740
+ },
741
+ "role": {
742
+ "anyOf": [
743
+ {
744
+ "type": "string",
745
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$",
746
+ "patternErrorMessage": "A role key is lower-case: it starts with a letter and continues with letters, digits and underscores, up to 63 characters in all — `operate`, `night_shift`. A capital, a dash, a dot, a space or a leading digit is refused, and `defaults` is reserved."
747
+ },
748
+ {
749
+ "minItems": 1,
750
+ "maxItems": 50,
751
+ "type": "array",
752
+ "items": {
753
+ "type": "string",
754
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$",
755
+ "patternErrorMessage": "A role key is lower-case: it starts with a letter and continues with letters, digits and underscores, up to 63 characters in all — `operate`, `night_shift`. A capital, a dash, a dot, a space or a leading digit is refused, and `defaults` is reserved."
756
+ }
757
+ }
758
+ ],
759
+ "defaultSnippets": [
760
+ {
761
+ "label": "one role",
762
+ "description": "The role that may use this; a role that inherits from it may too.",
763
+ "body": "${1:operate}"
764
+ },
765
+ {
766
+ "label": "any of several roles",
767
+ "description": "A list of roles; holding one of them, or inheriting from one, is enough.",
768
+ "body": [
769
+ "${1:operate}",
770
+ "${2:admin}"
771
+ ]
772
+ }
773
+ ],
774
+ "description": "Which role may start this action: one role key, or a list of keys when several roles qualify. A role qualifies when it, or a role it inherits from, is named. Without this, the first rule of `access.rules` that fits the entry decides, and without a fitting rule the organization's default for `invoke` applies. A key that names no role of the organization is a warning when you publish, never an error, and grants nothing. The robot ignores it; the cloud enforces it."
675
775
  }
676
776
  },
677
777
  "required": [
@@ -691,7 +791,7 @@
691
791
  }
692
792
  ]
693
793
  },
694
- "description": "Things the robot does on request that take time, each reported as a job with progress. **At most one job runs per action slug**: a second call is refused `busy`, and every observer of that slug watches the same job. Keys are slugs, one namespace across all five exposure sections, which is what lets a role grant say `{robot, slug}` without naming a kind; `bridge_state` and `robot_details` are built-in, and `history` is reserved because `GET …/jobs/history` would shadow an action of that name; all three are refused when the document is validated.",
794
+ "description": "Things the robot does on request that take time, each reported as a job with progress. **At most one job runs per action slug**: a second call is refused `busy`, and every observer of that slug watches the same job. Keys are slugs, one namespace across all five exposure sections, which is what lets an app lock name `{robot, slug}` without naming a kind; `bridge_state` and `robot_details` are built-in, `history` is reserved because `GET …/jobs/history` would shadow an action of that name, and `assets` and `job_history` are reserved because they name the robot-level capabilities; all five are refused when the document is validated.",
695
795
  "defaultSnippets": [
696
796
  {
697
797
  "label": "an action",
@@ -893,6 +993,41 @@
893
993
  "type": "string",
894
994
  "minLength": 1,
895
995
  "maxLength": 2000
996
+ },
997
+ "role": {
998
+ "anyOf": [
999
+ {
1000
+ "type": "string",
1001
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$",
1002
+ "patternErrorMessage": "A role key is lower-case: it starts with a letter and continues with letters, digits and underscores, up to 63 characters in all — `operate`, `night_shift`. A capital, a dash, a dot, a space or a leading digit is refused, and `defaults` is reserved."
1003
+ },
1004
+ {
1005
+ "minItems": 1,
1006
+ "maxItems": 50,
1007
+ "type": "array",
1008
+ "items": {
1009
+ "type": "string",
1010
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$",
1011
+ "patternErrorMessage": "A role key is lower-case: it starts with a letter and continues with letters, digits and underscores, up to 63 characters in all — `operate`, `night_shift`. A capital, a dash, a dot, a space or a leading digit is refused, and `defaults` is reserved."
1012
+ }
1013
+ }
1014
+ ],
1015
+ "defaultSnippets": [
1016
+ {
1017
+ "label": "one role",
1018
+ "description": "The role that may use this; a role that inherits from it may too.",
1019
+ "body": "${1:operate}"
1020
+ },
1021
+ {
1022
+ "label": "any of several roles",
1023
+ "description": "A list of roles; holding one of them, or inheriting from one, is enough.",
1024
+ "body": [
1025
+ "${1:operate}",
1026
+ "${2:admin}"
1027
+ ]
1028
+ }
1029
+ ],
1030
+ "description": "Which role may call this service: one role key, or a list of keys when several roles qualify. A role qualifies when it, or a role it inherits from, is named. Without this, the first rule of `access.rules` that fits the entry decides, and without a fitting rule the organization's default for `invoke` applies. A key that names no role of the organization is a warning when you publish, never an error, and grants nothing. The robot ignores it; the cloud enforces it."
896
1031
  }
897
1032
  },
898
1033
  "required": [
@@ -912,7 +1047,7 @@
912
1047
  }
913
1048
  ]
914
1049
  },
915
- "description": "ROS service calls the robot answers — one request, one reply. Unlike an action a service reports **no progress** and the call returns with its result already on the job, so there is nothing left to observe; a second concurrent call is still refused `busy`, exactly as for an action. Keys are slugs, one namespace across all five exposure sections, which is what lets a role grant say `{robot, slug}` without naming a kind; `bridge_state` and `robot_details` are built-in, and `history` is reserved because `GET …/jobs/history` would shadow an action of that name; all three are refused when the document is validated.",
1050
+ "description": "ROS service calls the robot answers — one request, one reply. Unlike an action a service reports **no progress** and the call returns with its result already on the job, so there is nothing left to observe; a second concurrent call is still refused `busy`, exactly as for an action. Keys are slugs, one namespace across all five exposure sections, which is what lets an app lock name `{robot, slug}` without naming a kind; `bridge_state` and `robot_details` are built-in, `history` is reserved because `GET …/jobs/history` would shadow an action of that name, and `assets` and `job_history` are reserved because they name the robot-level capabilities; all five are refused when the document is validated.",
916
1051
  "defaultSnippets": [
917
1052
  {
918
1053
  "label": "a service",
@@ -1164,6 +1299,41 @@
1164
1299
  "type": "string",
1165
1300
  "minLength": 1,
1166
1301
  "maxLength": 2000
1302
+ },
1303
+ "role": {
1304
+ "anyOf": [
1305
+ {
1306
+ "type": "string",
1307
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$",
1308
+ "patternErrorMessage": "A role key is lower-case: it starts with a letter and continues with letters, digits and underscores, up to 63 characters in all — `operate`, `night_shift`. A capital, a dash, a dot, a space or a leading digit is refused, and `defaults` is reserved."
1309
+ },
1310
+ {
1311
+ "minItems": 1,
1312
+ "maxItems": 50,
1313
+ "type": "array",
1314
+ "items": {
1315
+ "type": "string",
1316
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$",
1317
+ "patternErrorMessage": "A role key is lower-case: it starts with a letter and continues with letters, digits and underscores, up to 63 characters in all — `operate`, `night_shift`. A capital, a dash, a dot, a space or a leading digit is refused, and `defaults` is reserved."
1318
+ }
1319
+ }
1320
+ ],
1321
+ "defaultSnippets": [
1322
+ {
1323
+ "label": "one role",
1324
+ "description": "The role that may use this; a role that inherits from it may too.",
1325
+ "body": "${1:operate}"
1326
+ },
1327
+ {
1328
+ "label": "any of several roles",
1329
+ "description": "A list of roles; holding one of them, or inheriting from one, is enough.",
1330
+ "body": [
1331
+ "${1:operate}",
1332
+ "${2:admin}"
1333
+ ]
1334
+ }
1335
+ ],
1336
+ "description": "Which role may send to this publisher, which is what driving the robot is: one role key, or a list of keys when several roles qualify. A role qualifies when it, or a role it inherits from, is named. Without this, the first rule of `access.rules` that fits the entry decides, and without a fitting rule the organization's default for `publish` applies. A key that names no role of the organization is a warning when you publish, never an error, and grants nothing. The robot ignores it; the cloud enforces it."
1167
1337
  }
1168
1338
  },
1169
1339
  "required": [
@@ -1220,7 +1390,7 @@
1220
1390
  }
1221
1391
  ]
1222
1392
  },
1223
- "description": "Topics clients may send to, and where the format's whole safety story lives. The `message` template fixes every value a caller cannot change, and **`failsafe` is required**: once a client falls silent the bridge sends the failsafe message itself, so an operator whose window closed does not leave a robot driving. Keys are slugs, one namespace across all five exposure sections, which is what lets a role grant say `{robot, slug}` without naming a kind; `bridge_state` and `robot_details` are built-in, and `history` is reserved because `GET …/jobs/history` would shadow an action of that name; all three are refused when the document is validated.",
1393
+ "description": "Topics clients may send to, and where the format's whole safety story lives. The `message` template fixes every value a caller cannot change, and **`failsafe` is required**: once a client falls silent the bridge sends the failsafe message itself, so an operator whose window closed does not leave a robot driving. Keys are slugs, one namespace across all five exposure sections, which is what lets an app lock name `{robot, slug}` without naming a kind; `bridge_state` and `robot_details` are built-in, `history` is reserved because `GET …/jobs/history` would shadow an action of that name, and `assets` and `job_history` are reserved because they name the robot-level capabilities; all five are refused when the document is validated.",
1224
1394
  "defaultSnippets": [
1225
1395
  {
1226
1396
  "label": "a publisher, with its parameters and its failsafe",
@@ -1574,6 +1744,41 @@
1574
1744
  "type": "string",
1575
1745
  "minLength": 1,
1576
1746
  "maxLength": 2000
1747
+ },
1748
+ "role": {
1749
+ "anyOf": [
1750
+ {
1751
+ "type": "string",
1752
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$",
1753
+ "patternErrorMessage": "A role key is lower-case: it starts with a letter and continues with letters, digits and underscores, up to 63 characters in all — `operate`, `night_shift`. A capital, a dash, a dot, a space or a leading digit is refused, and `defaults` is reserved."
1754
+ },
1755
+ {
1756
+ "minItems": 1,
1757
+ "maxItems": 50,
1758
+ "type": "array",
1759
+ "items": {
1760
+ "type": "string",
1761
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$",
1762
+ "patternErrorMessage": "A role key is lower-case: it starts with a letter and continues with letters, digits and underscores, up to 63 characters in all — `operate`, `night_shift`. A capital, a dash, a dot, a space or a leading digit is refused, and `defaults` is reserved."
1763
+ }
1764
+ }
1765
+ ],
1766
+ "defaultSnippets": [
1767
+ {
1768
+ "label": "one role",
1769
+ "description": "The role that may use this; a role that inherits from it may too.",
1770
+ "body": "${1:operate}"
1771
+ },
1772
+ {
1773
+ "label": "any of several roles",
1774
+ "description": "A list of roles; holding one of them, or inheriting from one, is enough.",
1775
+ "body": [
1776
+ "${1:operate}",
1777
+ "${2:admin}"
1778
+ ]
1779
+ }
1780
+ ],
1781
+ "description": "Which role may see this camera: one role key, or a list of keys when several roles qualify. A role qualifies when it, or a role it inherits from, is named. Without this, the first rule of `access.rules` that fits the entry decides, and without a fitting rule the organization's default for `read` applies. A key that names no role of the organization is a warning when you publish, never an error, and grants nothing. The robot ignores it; the cloud enforces it."
1577
1782
  }
1578
1783
  },
1579
1784
  "required": [
@@ -1604,7 +1809,7 @@
1604
1809
  }
1605
1810
  ]
1606
1811
  },
1607
- "description": "Video the robot streams, and the still frames the cloud serves from it. `width`, `height`, `fps` and `bitrate_kbps` are what **the bridge produces before sending**, not what the camera captures — they live in the configuration rather than in a viewer's request precisely so that no viewer can make a robot send more. Keys are slugs, one namespace across all five exposure sections, which is what lets a role grant say `{robot, slug}` without naming a kind; `bridge_state` and `robot_details` are built-in, and `history` is reserved because `GET …/jobs/history` would shadow an action of that name; all three are refused when the document is validated.",
1812
+ "description": "Video the robot streams, and the still frames the cloud serves from it. `width`, `height`, `fps` and `bitrate_kbps` are what **the bridge produces before sending**, not what the camera captures — they live in the configuration rather than in a viewer's request precisely so that no viewer can make a robot send more. Keys are slugs, one namespace across all five exposure sections, which is what lets an app lock name `{robot, slug}` without naming a kind; `bridge_state` and `robot_details` are built-in, `history` is reserved because `GET …/jobs/history` would shadow an action of that name, and `assets` and `job_history` are reserved because they name the robot-level capabilities; all five are refused when the document is validated.",
1608
1813
  "defaultSnippets": [
1609
1814
  {
1610
1815
  "label": "a camera",
@@ -1626,6 +1831,185 @@
1626
1831
  }
1627
1832
  ]
1628
1833
  },
1834
+ "access": {
1835
+ "type": "object",
1836
+ "properties": {
1837
+ "rules": {
1838
+ "maxItems": 100,
1839
+ "type": "array",
1840
+ "items": {
1841
+ "type": "object",
1842
+ "properties": {
1843
+ "match": {
1844
+ "type": "string",
1845
+ "maxLength": 255,
1846
+ "pattern": "^(?:\\/(?:\\*\\*|(?![A-Za-z0-9_*]*\\*\\*)(?:\\*|[A-Za-z_])[A-Za-z0-9_*]*))+$",
1847
+ "description": "A glob over the ROS name an entry is exposed by: the `topic` of a datapoint or a publisher, the `ros_name` of a service or an action, the source topic of a camera that reads a ROS topic. `*` stands for one name segment, or for any characters inside one (`/joint_*`); `**` stands for any number of segments, none included, so `/arm/**` fits `/arm` and everything below it. Always absolute.",
1848
+ "patternErrorMessage": "A match pattern is an absolute ROS graph name in which `*` stands for any characters inside one segment and `**` for any number of whole segments — `/arm/**`, `/diagnostics/*`, `/joint_*`. It begins with a slash. A relative pattern, a trailing slash, a dash, a dot, or `**` mixed into a longer segment is refused."
1849
+ },
1850
+ "kinds": {
1851
+ "minItems": 1,
1852
+ "maxItems": 3,
1853
+ "type": "array",
1854
+ "items": {
1855
+ "type": "string",
1856
+ "enum": [
1857
+ "read",
1858
+ "invoke",
1859
+ "publish"
1860
+ ],
1861
+ "enumDescriptions": [
1862
+ "Datapoints and cameras: seeing what the robot reports.",
1863
+ "Services and actions: asking the robot to do something.",
1864
+ "Publishers: sending to the robot, which is what driving it is."
1865
+ ]
1866
+ },
1867
+ "description": "Narrows the rule to some kinds of access. Without it the rule fits entries of every kind."
1868
+ },
1869
+ "role": {
1870
+ "anyOf": [
1871
+ {
1872
+ "type": "string",
1873
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$",
1874
+ "patternErrorMessage": "A role key is lower-case: it starts with a letter and continues with letters, digits and underscores, up to 63 characters in all — `operate`, `night_shift`. A capital, a dash, a dot, a space or a leading digit is refused, and `defaults` is reserved."
1875
+ },
1876
+ {
1877
+ "minItems": 1,
1878
+ "maxItems": 50,
1879
+ "type": "array",
1880
+ "items": {
1881
+ "type": "string",
1882
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$",
1883
+ "patternErrorMessage": "A role key is lower-case: it starts with a letter and continues with letters, digits and underscores, up to 63 characters in all — `operate`, `night_shift`. A capital, a dash, a dot, a space or a leading digit is refused, and `defaults` is reserved."
1884
+ }
1885
+ }
1886
+ ],
1887
+ "defaultSnippets": [
1888
+ {
1889
+ "label": "one role",
1890
+ "description": "The role that may use this; a role that inherits from it may too.",
1891
+ "body": "${1:operate}"
1892
+ },
1893
+ {
1894
+ "label": "any of several roles",
1895
+ "description": "A list of roles; holding one of them, or inheriting from one, is enough.",
1896
+ "body": [
1897
+ "${1:operate}",
1898
+ "${2:admin}"
1899
+ ]
1900
+ }
1901
+ ],
1902
+ "description": "The role that may use what this rule fits: one key, or a list of keys when several roles qualify. A role qualifies when it, or a role it inherits from, is named. A key that names no role of the organization is a warning when you publish and grants nothing."
1903
+ }
1904
+ },
1905
+ "required": [
1906
+ "match",
1907
+ "role"
1908
+ ],
1909
+ "additionalProperties": false
1910
+ },
1911
+ "description": "Ordered rules that give a role to every entry whose ROS name fits `match`, so a whole namespace is covered by one line. For an entry the order of precedence is its own `role`, then the first rule that fits it, then the organization's default for its kind. A rule that fits no entry of this document is a warning and changes nothing.",
1912
+ "defaultSnippets": [
1913
+ {
1914
+ "label": "a rule over a namespace",
1915
+ "description": "Gives everything under `/arm` to one role. The first rule that fits an entry decides, so a narrower rule goes above a wider one.",
1916
+ "body": [
1917
+ {
1918
+ "match": "${1:/arm/**}",
1919
+ "role": "${2:admin}"
1920
+ }
1921
+ ]
1922
+ }
1923
+ ]
1924
+ },
1925
+ "assets": {
1926
+ "anyOf": [
1927
+ {
1928
+ "type": "string",
1929
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$",
1930
+ "patternErrorMessage": "A role key is lower-case: it starts with a letter and continues with letters, digits and underscores, up to 63 characters in all — `operate`, `night_shift`. A capital, a dash, a dot, a space or a leading digit is refused, and `defaults` is reserved."
1931
+ },
1932
+ {
1933
+ "minItems": 1,
1934
+ "maxItems": 50,
1935
+ "type": "array",
1936
+ "items": {
1937
+ "type": "string",
1938
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$",
1939
+ "patternErrorMessage": "A role key is lower-case: it starts with a letter and continues with letters, digits and underscores, up to 63 characters in all — `operate`, `night_shift`. A capital, a dash, a dot, a space or a leading digit is refused, and `defaults` is reserved."
1940
+ }
1941
+ }
1942
+ ],
1943
+ "defaultSnippets": [
1944
+ {
1945
+ "label": "one role",
1946
+ "description": "The role that may use this; a role that inherits from it may too.",
1947
+ "body": "${1:operate}"
1948
+ },
1949
+ {
1950
+ "label": "any of several roles",
1951
+ "description": "A list of roles; holding one of them, or inheriting from one, is enough.",
1952
+ "body": [
1953
+ "${1:operate}",
1954
+ "${2:admin}"
1955
+ ]
1956
+ }
1957
+ ],
1958
+ "description": "Who may use this robot's asset store — the meshes and the URDF a viewer draws it from — in place of the organization's default for `assets`. One role key, or a list of keys."
1959
+ },
1960
+ "job_history": {
1961
+ "anyOf": [
1962
+ {
1963
+ "type": "string",
1964
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$",
1965
+ "patternErrorMessage": "A role key is lower-case: it starts with a letter and continues with letters, digits and underscores, up to 63 characters in all — `operate`, `night_shift`. A capital, a dash, a dot, a space or a leading digit is refused, and `defaults` is reserved."
1966
+ },
1967
+ {
1968
+ "minItems": 1,
1969
+ "maxItems": 50,
1970
+ "type": "array",
1971
+ "items": {
1972
+ "type": "string",
1973
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$",
1974
+ "patternErrorMessage": "A role key is lower-case: it starts with a letter and continues with letters, digits and underscores, up to 63 characters in all — `operate`, `night_shift`. A capital, a dash, a dot, a space or a leading digit is refused, and `defaults` is reserved."
1975
+ }
1976
+ }
1977
+ ],
1978
+ "defaultSnippets": [
1979
+ {
1980
+ "label": "one role",
1981
+ "description": "The role that may use this; a role that inherits from it may too.",
1982
+ "body": "${1:operate}"
1983
+ },
1984
+ {
1985
+ "label": "any of several roles",
1986
+ "description": "A list of roles; holding one of them, or inheriting from one, is enough.",
1987
+ "body": [
1988
+ "${1:operate}",
1989
+ "${2:admin}"
1990
+ ]
1991
+ }
1992
+ ],
1993
+ "description": "Who may read this robot's job history, in place of the organization's default for `job_history`. One role key, or a list of keys. A run names the person who started it, so whoever may read the history learns who else has been driving the robot."
1994
+ }
1995
+ },
1996
+ "additionalProperties": false,
1997
+ "description": "Who may use what on this robot, beyond the `role` an entry can carry itself: ordered `rules` over ROS name patterns, and the robot-level `assets` and `job_history`. Everything in it is optional. For an entry the precedence is its own `role`, then the first rule that fits, then the organization's default for its kind; only the published version counts. The robot ignores this section.",
1998
+ "defaultSnippets": [
1999
+ {
2000
+ "label": "access, with one rule",
2001
+ "description": "A rule that gives everything under `/arm` to one role; entries it does not fit keep the organization's defaults.",
2002
+ "body": {
2003
+ "rules": [
2004
+ {
2005
+ "match": "${1:/arm/**}",
2006
+ "role": "${2:admin}"
2007
+ }
2008
+ ]
2009
+ }
2010
+ }
2011
+ ]
2012
+ },
1629
2013
  "low_bandwidth": {
1630
2014
  "description": "Overrides for the bridge's low-bandwidth mode; see the section schema.",
1631
2015
  "defaultSnippets": [
@@ -16,6 +16,36 @@
16
16
  "type": "string",
17
17
  "format": "date-time",
18
18
  "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))$"
19
+ },
20
+ "published_by": {
21
+ "description": "Who published the version. `null` when the member has since been removed, or when the version is older than this field. Absent when the server predates this field: read an absent field as unknown, the same as `null`. The cloud always sends it.",
22
+ "anyOf": [
23
+ {
24
+ "type": "object",
25
+ "properties": {
26
+ "id": {
27
+ "type": "string",
28
+ "format": "uuid",
29
+ "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)$",
30
+ "description": "The team member's id."
31
+ },
32
+ "name": {
33
+ "type": "string",
34
+ "minLength": 1,
35
+ "maxLength": 200,
36
+ "description": "The member's display name, or the local part of the email address when the member has none. Never a full email address."
37
+ }
38
+ },
39
+ "required": [
40
+ "id",
41
+ "name"
42
+ ],
43
+ "additionalProperties": false
44
+ },
45
+ {
46
+ "type": "null"
47
+ }
48
+ ]
19
49
  }
20
50
  },
21
51
  "required": [
@@ -8,11 +8,11 @@
8
8
  "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$",
9
9
  "description": "The address to invite. An invitation always bypasses the domain whitelist — a developer inviting somebody by hand has already made the decision the whitelist automates."
10
10
  },
11
- "role_id": {
12
- "description": "The role the invitee gets on acceptance. Absent means the app's `default_role_id`.",
11
+ "role": {
12
+ "description": "The role the invitee gets on acceptance, by key. Absent means the app's `default_role`, and `409 target_state_conflict` naming `default_role` when the app has none. A key that names no role is accepted and grants nothing.",
13
13
  "type": "string",
14
- "format": "uuid",
15
- "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)$"
14
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$",
15
+ "patternErrorMessage": "A role key is lower-case: it starts with a letter and continues with letters, digits and underscores, up to 63 characters in all — `operate`, `night_shift`. A capital, a dash, a dot, a space or a leading digit is refused, and `defaults` is reserved."
16
16
  },
17
17
  "display_name": {
18
18
  "description": "An optional name to pre-fill the account with; the invitee can change it afterwards.",
@@ -27,11 +27,11 @@
27
27
  }
28
28
  ]
29
29
  },
30
- "role_id": {
31
- "description": "The role the new user holds. Absent means the app's `default_role_id`, and `409 target_state_conflict` when the app has none or its default no longer resolves; a role belonging to another app is `404 not_found`, the same refusal a role that never existed gets.",
30
+ "role": {
31
+ "description": "The role the new user holds, by key. Absent means the app's `default_role`, and `409 target_state_conflict` naming `default_role` when the app has none. A key that names no role is accepted and grants nothing; `GET /api/org/roles` lists it under `dangling`.",
32
32
  "type": "string",
33
- "format": "uuid",
34
- "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)$"
33
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$",
34
+ "patternErrorMessage": "A role key is lower-case: it starts with a letter and continues with letters, digits and underscores, up to 63 characters in all — `operate`, `night_shift`. A capital, a dash, a dot, a space or a leading digit is refused, and `defaults` is reserved."
35
35
  }
36
36
  },
37
37
  "required": [
@@ -0,0 +1,33 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "key": {
6
+ "type": "string",
7
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$",
8
+ "patternErrorMessage": "A role key is lower-case: it starts with a letter and continues with letters, digits and underscores, up to 63 characters in all — `operate`, `night_shift`. A capital, a dash, a dot, a space or a leading digit is refused, and `defaults` is reserved.",
9
+ "description": "The new role's key, unique in the organization. Documents and assignments name the role by it."
10
+ },
11
+ "name": {
12
+ "type": "string",
13
+ "minLength": 1,
14
+ "maxLength": 60,
15
+ "description": "The display name, 1 to 60 characters; surrounding spaces are removed."
16
+ },
17
+ "inherits": {
18
+ "description": "Keys of the roles to inherit from. A key that names no role is accepted and warns. Left out, the role inherits from nobody; a key that would lead back to this role is refused with `role_cycle`.",
19
+ "maxItems": 50,
20
+ "type": "array",
21
+ "items": {
22
+ "type": "string",
23
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$",
24
+ "patternErrorMessage": "A role key is lower-case: it starts with a letter and continues with letters, digits and underscores, up to 63 characters in all — `operate`, `night_shift`. A capital, a dash, a dot, a space or a leading digit is refused, and `defaults` is reserved."
25
+ }
26
+ }
27
+ },
28
+ "required": [
29
+ "key",
30
+ "name"
31
+ ],
32
+ "additionalProperties": false
33
+ }