@panneau/protocol 5.0.0-alpha.2 → 5.0.0-alpha.4

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 (44) hide show
  1. package/dist/conformance/index.d.ts.map +1 -1
  2. package/dist/conformance/index.js +64 -1
  3. package/dist/conformance/index.js.map +1 -1
  4. package/dist/index.js +2 -2
  5. package/dist/lint.d.ts +2 -1
  6. package/dist/lint.d.ts.map +1 -1
  7. package/dist/lint.js +27 -1
  8. package/dist/lint.js.map +1 -1
  9. package/dist/mock/example.d.ts +2 -1
  10. package/dist/mock/example.d.ts.map +1 -1
  11. package/dist/mock/example.js +218 -141
  12. package/dist/mock/example.js.map +1 -1
  13. package/dist/mock/index.d.ts.map +1 -1
  14. package/dist/mock/index.js +165 -6
  15. package/dist/mock/index.js.map +1 -1
  16. package/dist/openapi.d.ts.map +1 -1
  17. package/dist/openapi.js +20 -95
  18. package/dist/openapi.js.map +1 -1
  19. package/dist/schemas/action.d.ts +1 -0
  20. package/dist/schemas/action.d.ts.map +1 -1
  21. package/dist/schemas/action.js +1 -0
  22. package/dist/schemas/action.js.map +1 -1
  23. package/dist/schemas/api.d.ts +114 -82
  24. package/dist/schemas/api.d.ts.map +1 -1
  25. package/dist/schemas/api.js +70 -27
  26. package/dist/schemas/api.js.map +1 -1
  27. package/dist/schemas/definition.d.ts +2 -0
  28. package/dist/schemas/definition.d.ts.map +1 -1
  29. package/dist/schemas/definition.js +2 -2
  30. package/dist/schemas/definition.js.map +1 -1
  31. package/dist/schemas/field.js +3 -3
  32. package/dist/schemas/field.js.map +1 -1
  33. package/dist/schemas/index.d.ts +110 -79
  34. package/dist/schemas/index.d.ts.map +1 -1
  35. package/dist/schemas/index.js +11 -5
  36. package/dist/schemas/index.js.map +1 -1
  37. package/dist/schemas/resource.d.ts +2 -0
  38. package/dist/schemas/resource.d.ts.map +1 -1
  39. package/dist/schemas/resource.js +1 -0
  40. package/dist/schemas/resource.js.map +1 -1
  41. package/package.json +1 -1
  42. package/schema/boot.schema.json +7 -0
  43. package/schema/definition.schema.json +7 -0
  44. package/schema/openapi.json +317 -462
@@ -623,6 +623,16 @@
623
623
  }
624
624
  }
625
625
  },
626
+ "400": {
627
+ "description": "Bad request, such as a dry run of an action that does not declare `dryRun`.",
628
+ "content": {
629
+ "application/problem+json": {
630
+ "schema": {
631
+ "$ref": "#/components/schemas/Problem"
632
+ }
633
+ }
634
+ }
635
+ },
626
636
  "401": {
627
637
  "description": "Not authenticated.",
628
638
  "content": {
@@ -821,303 +831,27 @@
821
831
  }
822
832
  }
823
833
  },
824
- "/media": {
825
- "get": {
826
- "operationId": "listMedia",
827
- "parameters": [
828
- {
829
- "name": "page",
830
- "in": "query",
831
- "required": false,
832
- "description": "Page number, from 1.",
833
- "schema": {
834
- "type": "integer",
835
- "minimum": 1
836
- }
837
- },
838
- {
839
- "name": "perPage",
840
- "in": "query",
841
- "required": false,
842
- "description": "Items per page.",
843
- "schema": {
844
- "type": "integer",
845
- "minimum": 1
846
- }
847
- },
848
- {
849
- "name": "sort",
850
- "in": "query",
851
- "required": false,
852
- "description": "Comma-separated fields; a `-` prefix sorts descending.",
853
- "schema": {
854
- "type": "string"
855
- }
856
- },
857
- {
858
- "name": "filter",
859
- "in": "query",
860
- "required": false,
861
- "style": "deepObject",
862
- "explode": true,
863
- "description": "`filter[status]=published`; `filter[tags][]=a&filter[tags][]=b` for any of several values; `filter[published_at][from]=2026-01-01&filter[published_at][to]=2026-01-31` for the inclusive bounds of a range filter (`date-range`), without the open end.",
864
- "schema": {
865
- "type": "object",
866
- "additionalProperties": true
867
- }
868
- },
869
- {
870
- "name": "q",
871
- "in": "query",
872
- "required": false,
873
- "description": "Search.",
874
- "schema": {
875
- "type": "string"
876
- }
877
- },
878
- {
879
- "name": "fields",
880
- "in": "query",
881
- "required": false,
882
- "description": "Comma-separated fields to include in each item.",
883
- "schema": {
884
- "type": "string"
885
- }
886
- }
887
- ],
888
- "responses": {
889
- "200": {
890
- "description": "A page of media.",
891
- "content": {
892
- "application/json": {
893
- "schema": {
894
- "$ref": "#/components/schemas/MediaListResponse"
895
- }
896
- }
897
- }
898
- },
899
- "401": {
900
- "description": "Not authenticated.",
901
- "content": {
902
- "application/problem+json": {
903
- "schema": {
904
- "$ref": "#/components/schemas/Problem"
905
- }
906
- }
907
- }
908
- },
909
- "403": {
910
- "description": "Not allowed.",
911
- "content": {
912
- "application/problem+json": {
913
- "schema": {
914
- "$ref": "#/components/schemas/Problem"
915
- }
916
- }
917
- }
918
- }
919
- }
920
- },
834
+ "/uploads/sign": {
921
835
  "post": {
922
- "operationId": "uploadMedia",
923
- "requestBody": {
924
- "required": true,
925
- "content": {
926
- "multipart/form-data": {
927
- "schema": {
928
- "type": "object",
929
- "required": [
930
- "file"
931
- ],
932
- "properties": {
933
- "file": {
934
- "type": "string",
935
- "contentMediaType": "application/octet-stream"
936
- },
937
- "name": {
938
- "type": "string"
939
- },
940
- "tags": {
941
- "type": "array",
942
- "items": {
943
- "type": "string"
944
- }
945
- }
946
- }
947
- }
948
- }
949
- }
950
- },
951
- "responses": {
952
- "201": {
953
- "description": "The created media.",
954
- "content": {
955
- "application/json": {
956
- "schema": {
957
- "$ref": "#/components/schemas/MediaResponse"
958
- }
959
- }
960
- }
961
- },
962
- "401": {
963
- "description": "Not authenticated.",
964
- "content": {
965
- "application/problem+json": {
966
- "schema": {
967
- "$ref": "#/components/schemas/Problem"
968
- }
969
- }
970
- }
971
- },
972
- "403": {
973
- "description": "Not allowed.",
974
- "content": {
975
- "application/problem+json": {
976
- "schema": {
977
- "$ref": "#/components/schemas/Problem"
978
- }
979
- }
980
- }
981
- },
982
- "422": {
983
- "description": "Invalid values: messages are in `errors`, keyed by dot path.",
984
- "content": {
985
- "application/problem+json": {
986
- "schema": {
987
- "$ref": "#/components/schemas/Problem"
988
- }
989
- }
990
- }
991
- }
992
- }
993
- }
994
- },
995
- "/media/tags": {
996
- "get": {
997
- "operationId": "listMediaTags",
998
- "responses": {
999
- "200": {
1000
- "description": "Tags in use.",
1001
- "content": {
1002
- "application/json": {
1003
- "schema": {
1004
- "type": "object",
1005
- "required": [
1006
- "data"
1007
- ],
1008
- "properties": {
1009
- "data": {
1010
- "type": "array",
1011
- "items": {
1012
- "type": "string"
1013
- }
1014
- }
1015
- }
1016
- }
1017
- }
1018
- }
1019
- },
1020
- "401": {
1021
- "description": "Not authenticated.",
1022
- "content": {
1023
- "application/problem+json": {
1024
- "schema": {
1025
- "$ref": "#/components/schemas/Problem"
1026
- }
1027
- }
1028
- }
1029
- },
1030
- "403": {
1031
- "description": "Not allowed.",
1032
- "content": {
1033
- "application/problem+json": {
1034
- "schema": {
1035
- "$ref": "#/components/schemas/Problem"
1036
- }
1037
- }
1038
- }
1039
- }
1040
- }
1041
- }
1042
- },
1043
- "/media/{id}": {
1044
- "parameters": [
1045
- {
1046
- "name": "id",
1047
- "in": "path",
1048
- "required": true,
1049
- "description": "Media id.",
1050
- "schema": {
1051
- "type": "string"
1052
- }
1053
- }
1054
- ],
1055
- "get": {
1056
- "operationId": "getMedia",
1057
- "responses": {
1058
- "200": {
1059
- "description": "The media.",
1060
- "content": {
1061
- "application/json": {
1062
- "schema": {
1063
- "$ref": "#/components/schemas/MediaResponse"
1064
- }
1065
- }
1066
- }
1067
- },
1068
- "401": {
1069
- "description": "Not authenticated.",
1070
- "content": {
1071
- "application/problem+json": {
1072
- "schema": {
1073
- "$ref": "#/components/schemas/Problem"
1074
- }
1075
- }
1076
- }
1077
- },
1078
- "403": {
1079
- "description": "Not allowed.",
1080
- "content": {
1081
- "application/problem+json": {
1082
- "schema": {
1083
- "$ref": "#/components/schemas/Problem"
1084
- }
1085
- }
1086
- }
1087
- },
1088
- "404": {
1089
- "description": "Not found.",
1090
- "content": {
1091
- "application/problem+json": {
1092
- "schema": {
1093
- "$ref": "#/components/schemas/Problem"
1094
- }
1095
- }
1096
- }
1097
- }
1098
- }
1099
- },
1100
- "patch": {
1101
- "operationId": "updateMedia",
1102
- "description": "Updates metadata, tags or the image `transform`.",
836
+ "operationId": "signUpload",
837
+ "summary": "Signs a request of the browser's S3 client. The first request of a file creates its upload.",
1103
838
  "requestBody": {
1104
839
  "required": true,
1105
840
  "content": {
1106
841
  "application/json": {
1107
842
  "schema": {
1108
- "type": "object",
1109
- "additionalProperties": true
843
+ "$ref": "#/components/schemas/UploadSignRequest"
1110
844
  }
1111
845
  }
1112
846
  }
1113
847
  },
1114
848
  "responses": {
1115
849
  "200": {
1116
- "description": "The updated media.",
850
+ "description": "The presigned request.",
1117
851
  "content": {
1118
852
  "application/json": {
1119
853
  "schema": {
1120
- "$ref": "#/components/schemas/MediaResponse"
854
+ "$ref": "#/components/schemas/UploadSignResponse"
1121
855
  }
1122
856
  }
1123
857
  }
@@ -1163,83 +897,33 @@
1163
897
  }
1164
898
  }
1165
899
  }
1166
- },
1167
- "delete": {
1168
- "operationId": "deleteMedia",
1169
- "responses": {
1170
- "204": {
1171
- "description": "Moved to the trash."
1172
- },
1173
- "401": {
1174
- "description": "Not authenticated.",
1175
- "content": {
1176
- "application/problem+json": {
1177
- "schema": {
1178
- "$ref": "#/components/schemas/Problem"
1179
- }
1180
- }
1181
- }
1182
- },
1183
- "403": {
1184
- "description": "Not allowed.",
1185
- "content": {
1186
- "application/problem+json": {
1187
- "schema": {
1188
- "$ref": "#/components/schemas/Problem"
1189
- }
1190
- }
1191
- }
1192
- },
1193
- "404": {
1194
- "description": "Not found.",
1195
- "content": {
1196
- "application/problem+json": {
1197
- "schema": {
1198
- "$ref": "#/components/schemas/Problem"
1199
- }
1200
- }
1201
- }
1202
- },
1203
- "409": {
1204
- "description": "Conflict with a business rule.",
1205
- "content": {
1206
- "application/problem+json": {
1207
- "schema": {
1208
- "$ref": "#/components/schemas/Problem"
1209
- }
1210
- }
1211
- }
1212
- }
1213
- }
1214
900
  }
1215
901
  },
1216
- "/media/{id}/file": {
902
+ "/uploads/{upload}/complete": {
1217
903
  "parameters": [
1218
904
  {
1219
- "name": "id",
905
+ "name": "upload",
1220
906
  "in": "path",
1221
907
  "required": true,
1222
- "description": "Media id.",
908
+ "description": "Upload id: `upl_…`.",
1223
909
  "schema": {
1224
910
  "type": "string"
1225
911
  }
1226
912
  }
1227
913
  ],
1228
914
  "post": {
1229
- "operationId": "replaceMediaFile",
915
+ "operationId": "completeUpload",
916
+ "summary": "Once the browser completed the upload in storage, checks the object and gives the upload, which values reference.",
1230
917
  "requestBody": {
1231
- "required": true,
918
+ "required": false,
1232
919
  "content": {
1233
- "multipart/form-data": {
920
+ "application/json": {
1234
921
  "schema": {
1235
922
  "type": "object",
1236
- "required": [
1237
- "file"
1238
- ],
1239
923
  "properties": {
1240
- "file": {
924
+ "name": {
1241
925
  "type": "string",
1242
- "contentMediaType": "application/octet-stream"
926
+ "description": "The file's name, which the key doesn't keep, since the backend chose it."
1243
927
  }
1244
928
  }
1245
929
  }
@@ -1248,11 +932,11 @@
1248
932
  },
1249
933
  "responses": {
1250
934
  "200": {
1251
- "description": "The media.",
935
+ "description": "The upload.",
1252
936
  "content": {
1253
937
  "application/json": {
1254
938
  "schema": {
1255
- "$ref": "#/components/schemas/MediaResponse"
939
+ "$ref": "#/components/schemas/UploadResponse"
1256
940
  }
1257
941
  }
1258
942
  }
@@ -1300,64 +984,6 @@
1300
984
  }
1301
985
  }
1302
986
  },
1303
- "/media/{id}/restore": {
1304
- "parameters": [
1305
- {
1306
- "name": "id",
1307
- "in": "path",
1308
- "required": true,
1309
- "description": "Media id.",
1310
- "schema": {
1311
- "type": "string"
1312
- }
1313
- }
1314
- ],
1315
- "post": {
1316
- "operationId": "restoreMedia",
1317
- "responses": {
1318
- "200": {
1319
- "description": "The restored media.",
1320
- "content": {
1321
- "application/json": {
1322
- "schema": {
1323
- "$ref": "#/components/schemas/MediaResponse"
1324
- }
1325
- }
1326
- }
1327
- },
1328
- "401": {
1329
- "description": "Not authenticated.",
1330
- "content": {
1331
- "application/problem+json": {
1332
- "schema": {
1333
- "$ref": "#/components/schemas/Problem"
1334
- }
1335
- }
1336
- }
1337
- },
1338
- "403": {
1339
- "description": "Not allowed.",
1340
- "content": {
1341
- "application/problem+json": {
1342
- "schema": {
1343
- "$ref": "#/components/schemas/Problem"
1344
- }
1345
- }
1346
- }
1347
- },
1348
- "404": {
1349
- "description": "Not found.",
1350
- "content": {
1351
- "application/problem+json": {
1352
- "schema": {
1353
- "$ref": "#/components/schemas/Problem"
1354
- }
1355
- }
1356
- }
1357
- }
1358
- }
1359
- }
1360
- },
1361
987
  "/auth/session": {
1362
988
  "get": {
1363
989
  "operationId": "getSession",
@@ -2287,15 +1913,15 @@
2287
1913
  }
2288
1914
  },
2289
1915
  "multiple": {
2290
- "description": "`select`, `relation`, `media`: the value is an array.",
1916
+ "description": "`select`, `relation`, `media`, `file`: the value is an array.",
2291
1917
  "type": "boolean"
2292
1918
  },
2293
1919
  "resource": {
2294
- "description": "`relation`: id of the related resource.",
1920
+ "description": "`relation`: id of the related resource. `media`: id of a resource of kind `media`, optional when the definition has only one.",
2295
1921
  "type": "string"
2296
1922
  },
2297
1923
  "accept": {
2298
- "description": "`media`: accepted MIME types.",
1924
+ "description": "`media`, `file`: accepted MIME types.",
2299
1925
  "type": "array",
2300
1926
  "items": {
2301
1927
  "type": "string"
@@ -2644,6 +2270,10 @@
2644
2270
  "description": "The action always answers `202` with a run.",
2645
2271
  "type": "boolean"
2646
2272
  },
2273
+ "dryRun": {
2274
+ "description": "The backend answers dry runs of this action (`dryRun` in the request): lists ask it how many items of a query selection will be skipped. Without it, the UI never sends `dryRun`, since a backend that ignores it would run the action.",
2275
+ "type": "boolean"
2276
+ },
2647
2277
  "url": {
2648
2278
  "description": "`link`: URL template, with `{id}` for the item.",
2649
2279
  "type": "string"
@@ -2719,6 +2349,11 @@
2719
2349
  "type": "string",
2720
2350
  "minLength": 1
2721
2351
  },
2352
+ "kind": {
2353
+ "description": "What the resource is. `media`: a library of media (decision 0026), with a `file` field and a `media` on each item. Without it, an ordinary resource. Clients treat a kind they don't know as an ordinary resource.",
2354
+ "type": "string",
2355
+ "minLength": 1
2356
+ },
2722
2357
  "label": {
2723
2358
  "type": "object",
2724
2359
  "properties": {
@@ -3005,9 +2640,11 @@
3005
2640
  "multipart",
3006
2641
  "tus",
3007
2642
  "presigned"
3008
- ]
2643
+ ],
2644
+ "description": "`multipart`: files go through `POST /media` and the requests that take them. `presigned`: the browser also sends files to storage itself, with URLs that `POST /uploads/sign` signs, then `POST /uploads/{upload}/complete` gives an upload that values reference."
3009
2645
  },
3010
2646
  "endpoint": {
2647
+ "description": "`presigned`: the base URL of the upload routes, when they are not `{api.baseUrl}/uploads`.",
3011
2648
  "type": "string"
3012
2649
  },
3013
2650
  "maxSize": {
@@ -3769,6 +3406,10 @@
3769
3406
  "type": "string"
3770
3407
  },
3771
3408
  "additionalProperties": {}
3409
+ },
3410
+ "dryRun": {
3411
+ "description": "Answer what the action would do without running it: a `200` action result whose `summary` counts the items that would succeed and those that would be skipped. Only for actions with `dryRun: true`.",
3412
+ "type": "boolean"
3772
3413
  }
3773
3414
  },
3774
3415
  "additionalProperties": {}
@@ -3972,20 +3613,28 @@
3972
3613
  "type": "object",
3973
3614
  "properties": {
3974
3615
  "crop": {
3975
- "description": "In pixels of the original image.",
3616
+ "description": "In whole pixels of the upright original image (after its EXIF orientation), from its top left corner.",
3976
3617
  "type": "object",
3977
3618
  "properties": {
3978
3619
  "x": {
3979
- "type": "number"
3620
+ "type": "integer",
3621
+ "minimum": 0,
3622
+ "maximum": 9007199254740991
3980
3623
  },
3981
3624
  "y": {
3982
- "type": "number"
3625
+ "type": "integer",
3626
+ "minimum": 0,
3627
+ "maximum": 9007199254740991
3983
3628
  },
3984
3629
  "width": {
3985
- "type": "number"
3630
+ "type": "integer",
3631
+ "exclusiveMinimum": 0,
3632
+ "maximum": 9007199254740991
3986
3633
  },
3987
3634
  "height": {
3988
- "type": "number"
3635
+ "type": "integer",
3636
+ "exclusiveMinimum": 0,
3637
+ "maximum": 9007199254740991
3989
3638
  }
3990
3639
  },
3991
3640
  "required": [
@@ -3997,6 +3646,7 @@
3997
3646
  "additionalProperties": {}
3998
3647
  },
3999
3648
  "rotate": {
3649
+ "description": "Clockwise, in degrees.",
4000
3650
  "anyOf": [
4001
3651
  {
4002
3652
  "type": "number",
@@ -4017,13 +3667,15 @@
4017
3667
  ]
4018
3668
  },
4019
3669
  "flipX": {
3670
+ "description": "Mirrors left to right (horizontal).",
4020
3671
  "type": "boolean"
4021
3672
  },
4022
3673
  "flipY": {
3674
+ "description": "Mirrors top to bottom (vertical).",
4023
3675
  "type": "boolean"
4024
3676
  },
4025
3677
  "focalPoint": {
4026
- "description": "Relative to the width and height, from 0 to 1.",
3678
+ "description": "From 0 to 1, relative to the width and height of the upright original image, not of the crop: changing the crop does not move it. Renderers map it into the transformed image and clamp it to the crop.",
4027
3679
  "type": "object",
4028
3680
  "properties": {
4029
3681
  "x": {
@@ -4044,27 +3696,73 @@
4044
3696
  "additionalProperties": {}
4045
3697
  }
4046
3698
  },
4047
- "additionalProperties": {}
3699
+ "additionalProperties": {},
3700
+ "description": "Non-destructive edits of an image, applied in this order: crop, then rotate, then flip."
4048
3701
  },
4049
- "Media": {
3702
+ "StoredFile": {
4050
3703
  "type": "object",
4051
3704
  "properties": {
4052
- "id": {
4053
- "$ref": "#/components/schemas/Id"
3705
+ "name": {
3706
+ "type": "string",
3707
+ "description": "The name of the file, as the user knows it."
4054
3708
  },
4055
- "version": {
4056
- "description": "Changes on every update. `null` when the backend has no versions.",
3709
+ "url": {
3710
+ "description": "Where to download it. A private file gets a temporary URL.",
4057
3711
  "type": [
4058
3712
  "string",
4059
3713
  "null"
4060
3714
  ]
4061
3715
  },
4062
- "abilities": {
4063
- "$ref": "#/components/schemas/Abilities"
3716
+ "mime": {
3717
+ "type": [
3718
+ "string",
3719
+ "null"
3720
+ ]
4064
3721
  },
4065
- "type": {
3722
+ "size": {
3723
+ "anyOf": [
3724
+ {
3725
+ "type": "integer",
3726
+ "minimum": 0,
3727
+ "maximum": 9007199254740991
3728
+ },
3729
+ {
3730
+ "type": "null"
3731
+ }
3732
+ ]
3733
+ }
3734
+ },
3735
+ "required": [
3736
+ "name"
3737
+ ],
3738
+ "additionalProperties": {},
3739
+ "description": "A file stored by the backend: the value of a `file` field in items. Requests send it back to keep the file, `{ \"upload\" }` to replace it, or `null` to remove it."
3740
+ },
3741
+ "UploadReference": {
3742
+ "type": "object",
3743
+ "properties": {
3744
+ "upload": {
3745
+ "type": "string",
3746
+ "minLength": 1
3747
+ }
3748
+ },
3749
+ "required": [
3750
+ "upload"
3751
+ ],
3752
+ "additionalProperties": {},
3753
+ "description": "A file uploaded directly to storage, by the id of its upload: in a file value, such as the `file` of a media, or an action parameter."
3754
+ },
3755
+ "Upload": {
3756
+ "type": "object",
3757
+ "properties": {
3758
+ "id": {
4066
3759
  "type": "string",
4067
- "description": "`image`, `video`, `audio`, `document`, `font`, or another type."
3760
+ "minLength": 1,
3761
+ "description": "The id of the upload: `upl_…`."
3762
+ },
3763
+ "key": {
3764
+ "description": "The key of the object in storage.",
3765
+ "type": "string"
4068
3766
  },
4069
3767
  "name": {
4070
3768
  "type": "string"
@@ -4076,10 +3774,130 @@
4076
3774
  "type": "integer",
4077
3775
  "minimum": 0,
4078
3776
  "maximum": 9007199254740991
3777
+ }
3778
+ },
3779
+ "required": [
3780
+ "id"
3781
+ ],
3782
+ "additionalProperties": {},
3783
+ "description": "A file the browser uploaded to storage, before it becomes a media, an import or another value."
3784
+ },
3785
+ "UploadResponse": {
3786
+ "type": "object",
3787
+ "properties": {
3788
+ "data": {
3789
+ "$ref": "#/components/schemas/Upload"
3790
+ }
3791
+ },
3792
+ "required": [
3793
+ "data"
3794
+ ],
3795
+ "additionalProperties": {}
3796
+ },
3797
+ "UploadSignRequest": {
3798
+ "type": "object",
3799
+ "properties": {
3800
+ "method": {
3801
+ "type": "string",
3802
+ "enum": [
3803
+ "GET",
3804
+ "POST",
3805
+ "PUT",
3806
+ "DELETE"
3807
+ ]
3808
+ },
3809
+ "key": {
3810
+ "type": "string",
3811
+ "minLength": 1
3812
+ },
3813
+ "uploadId": {
3814
+ "description": "The S3 multipart upload.",
3815
+ "type": "string"
3816
+ },
3817
+ "partNumber": {
3818
+ "type": "integer",
3819
+ "exclusiveMinimum": 0,
3820
+ "maximum": 9007199254740991
3821
+ },
3822
+ "contentType": {
3823
+ "type": "string"
4079
3824
  },
3825
+ "expiresIn": {
3826
+ "type": "integer",
3827
+ "exclusiveMinimum": 0,
3828
+ "maximum": 9007199254740991
3829
+ }
3830
+ },
3831
+ "required": [
3832
+ "method",
3833
+ "key"
3834
+ ],
3835
+ "additionalProperties": {},
3836
+ "description": "A request of the browser's S3 client to sign (Uppy 6's `signRequest`)."
3837
+ },
3838
+ "UploadSignResponse": {
3839
+ "type": "object",
3840
+ "properties": {
4080
3841
  "url": {
4081
3842
  "type": "string"
4082
3843
  },
3844
+ "key": {
3845
+ "description": "The key the backend chose, for the first request of a file.",
3846
+ "type": "string"
3847
+ },
3848
+ "headers": {
3849
+ "description": "Headers the URL was signed with, which the browser sends.",
3850
+ "type": "object",
3851
+ "propertyNames": {
3852
+ "type": "string"
3853
+ },
3854
+ "additionalProperties": {
3855
+ "type": "string"
3856
+ }
3857
+ },
3858
+ "upload": {
3859
+ "description": "The upload the first request of a file created: `upl_…`.",
3860
+ "type": "string"
3861
+ }
3862
+ },
3863
+ "required": [
3864
+ "url"
3865
+ ],
3866
+ "additionalProperties": {},
3867
+ "description": "A presigned request."
3868
+ },
3869
+ "MediaInfo": {
3870
+ "type": "object",
3871
+ "properties": {
3872
+ "type": {
3873
+ "type": "string",
3874
+ "description": "`image`, `video`, `audio`, `document`, `font`, or another type the backend knows."
3875
+ },
3876
+ "mime": {
3877
+ "type": [
3878
+ "string",
3879
+ "null"
3880
+ ]
3881
+ },
3882
+ "size": {
3883
+ "anyOf": [
3884
+ {
3885
+ "type": "integer",
3886
+ "minimum": 0,
3887
+ "maximum": 9007199254740991
3888
+ },
3889
+ {
3890
+ "type": "null"
3891
+ }
3892
+ ]
3893
+ },
3894
+ "url": {
3895
+ "description": "The main file to show or play: a rendition, or the original until it exists.",
3896
+ "type": [
3897
+ "string",
3898
+ "null"
3899
+ ]
3900
+ },
4083
3901
  "thumbnailUrl": {
4084
3902
  "type": [
4085
3903
  "string",
@@ -4087,6 +3905,7 @@
4087
3905
  ]
4088
3906
  },
4089
3907
  "variants": {
3908
+ "description": "Named renditions: sizes of an image, qualities of a video.",
4090
3909
  "type": "object",
4091
3910
  "propertyNames": {
4092
3911
  "type": "string"
@@ -4110,72 +3929,108 @@
4110
3929
  "additionalProperties": {}
4111
3930
  }
4112
3931
  },
3932
+ "width": {
3933
+ "type": [
3934
+ "number",
3935
+ "null"
3936
+ ]
3937
+ },
3938
+ "height": {
3939
+ "type": [
3940
+ "number",
3941
+ "null"
3942
+ ]
3943
+ },
3944
+ "duration": {
3945
+ "description": "In seconds.",
3946
+ "type": [
3947
+ "number",
3948
+ "null"
3949
+ ]
3950
+ },
3951
+ "status": {
3952
+ "description": "Where the processing of the file is: `pending` and `processing` until its renditions are made, then `ready` or `failed`. Without it, the media is ready.",
3953
+ "type": "string",
3954
+ "enum": [
3955
+ "pending",
3956
+ "processing",
3957
+ "ready",
3958
+ "failed"
3959
+ ]
3960
+ },
4113
3961
  "metadata": {
4114
3962
  "type": "object",
4115
3963
  "propertyNames": {
4116
3964
  "type": "string"
4117
3965
  },
4118
3966
  "additionalProperties": {}
4119
- },
4120
- "transform": {
4121
- "anyOf": [
4122
- {
4123
- "$ref": "#/components/schemas/MediaTransform"
4124
- },
4125
- {
4126
- "type": "null"
4127
- }
4128
- ]
4129
- },
4130
- "tags": {
4131
- "type": "array",
4132
- "items": {
4133
- "type": "string"
4134
- }
4135
3967
  }
4136
3968
  },
4137
3969
  "required": [
4138
- "id",
4139
- "version",
4140
- "abilities",
4141
- "type",
4142
- "name",
4143
- "mime",
4144
- "size",
4145
- "url"
3970
+ "type"
4146
3971
  ],
4147
- "additionalProperties": {}
3972
+ "additionalProperties": {},
3973
+ "description": "What the backend computed about the file of a media item: the `media` of the items of a `media` resource, and of the values of `media` fields. Read-only: the editable properties of a media are the fields of its resource."
4148
3974
  },
4149
- "MediaResponse": {
3975
+ "MediaItem": {
4150
3976
  "type": "object",
4151
3977
  "properties": {
4152
- "data": {
4153
- "$ref": "#/components/schemas/Media"
3978
+ "id": {
3979
+ "$ref": "#/components/schemas/Id"
3980
+ },
3981
+ "version": {
3982
+ "description": "Changes on every update. `null` when the backend has no versions.",
3983
+ "type": [
3984
+ "string",
3985
+ "null"
3986
+ ]
3987
+ },
3988
+ "abilities": {
3989
+ "$ref": "#/components/schemas/Abilities"
3990
+ },
3991
+ "media": {
3992
+ "$ref": "#/components/schemas/MediaInfo"
4154
3993
  }
4155
3994
  },
4156
3995
  "required": [
4157
- "data"
3996
+ "id",
3997
+ "version",
3998
+ "abilities",
3999
+ "media"
4158
4000
  ],
4159
- "additionalProperties": {}
4001
+ "additionalProperties": {},
4002
+ "description": "An item of a resource of kind `media`: the values of its fields (`file`, the original, and those of the project), and the `media` the backend computed."
4160
4003
  },
4161
- "MediaListResponse": {
4004
+ "MediaReference": {
4162
4005
  "type": "object",
4163
4006
  "properties": {
4164
- "data": {
4165
- "type": "array",
4166
- "items": {
4167
- "$ref": "#/components/schemas/Media"
4168
- }
4007
+ "id": {
4008
+ "$ref": "#/components/schemas/Id"
4169
4009
  },
4170
- "meta": {
4171
- "$ref": "#/components/schemas/Pagination"
4010
+ "label": {
4011
+ "description": "The `itemTitle` of the media.",
4012
+ "type": "string"
4013
+ },
4014
+ "media": {
4015
+ "$ref": "#/components/schemas/MediaInfo"
4016
+ },
4017
+ "transform": {
4018
+ "description": "The edits of the image for this use only, over those of the media.",
4019
+ "anyOf": [
4020
+ {
4021
+ "$ref": "#/components/schemas/MediaTransform"
4022
+ },
4023
+ {
4024
+ "type": "null"
4025
+ }
4026
+ ]
4172
4027
  }
4173
4028
  },
4174
4029
  "required": [
4175
- "data",
4176
- "meta"
4030
+ "id"
4177
4031
  ],
4178
- "additionalProperties": {}
4032
+ "additionalProperties": {},
4033
+ "description": "The value of a `media` field in items: the media, with what lists and fields show, and its edits for this use. Requests send the id, or `{ id, transform }`."
4179
4034
  },
4180
4035
  "Session": {
4181
4036
  "type": "object",