Commit 6124a0e
authored
feat: update types to match OpenAPI schema (#363)
* feat: update types to match OpenAPI schema
This PR updates TypeScript types to match the OpenAPI schema from
https://api.replicate.com/openapi.json
Changes:
- Account: add avatar_url field
- Status: remove "aborted" status (not in OpenAPI schema)
- FileObject: replace name, etag, checksum with checksums object
- Prediction: add data_removed, deadline, deployment fields; change version to support "hidden"; update metrics to use total_time; add web URL
- Training: convert from type alias to full interface with proper output structure
- ModelVersion: make cog_version and openapi_schema nullable
* fix: keep predict_time in Prediction metrics for backward compatibility
* feat: add "aborted" status to Status type
Per the OpenAPI schema, both predictions and trainings can have
an "aborted" status, which indicates the task was terminated
before it started running (e.g., when a deadline is reached
before execution begins).
* fix: add web URL to Training.urls
Per the OpenAPI schema, Training objects include a web URL
in their urls object, matching the Prediction interface.1 parent 922bf8e commit 6124a0e
2 files changed
+51
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
51 | | - | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
55 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| |||
85 | 86 | | |
86 | 87 | | |
87 | 88 | | |
88 | | - | |
89 | | - | |
| 89 | + | |
| 90 | + | |
90 | 91 | | |
91 | 92 | | |
92 | 93 | | |
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
96 | | - | |
| 97 | + | |
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
100 | 101 | | |
101 | 102 | | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
102 | 106 | | |
103 | 107 | | |
| 108 | + | |
104 | 109 | | |
105 | 110 | | |
106 | 111 | | |
| |||
111 | 116 | | |
112 | 117 | | |
113 | 118 | | |
| 119 | + | |
114 | 120 | | |
115 | 121 | | |
116 | 122 | | |
117 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
118 | 151 | | |
119 | 152 | | |
120 | 153 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
906 | 907 | | |
907 | 908 | | |
908 | 909 | | |
909 | | - | |
| 910 | + | |
910 | 911 | | |
911 | 912 | | |
912 | 913 | | |
| |||
1176 | 1177 | | |
1177 | 1178 | | |
1178 | 1179 | | |
1179 | | - | |
1180 | 1180 | | |
1181 | 1181 | | |
1182 | | - | |
1183 | | - | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
1184 | 1185 | | |
1185 | 1186 | | |
1186 | 1187 | | |
| |||
1190 | 1191 | | |
1191 | 1192 | | |
1192 | 1193 | | |
1193 | | - | |
1194 | 1194 | | |
1195 | 1195 | | |
1196 | 1196 | | |
| |||
1201 | 1201 | | |
1202 | 1202 | | |
1203 | 1203 | | |
1204 | | - | |
1205 | 1204 | | |
1206 | 1205 | | |
1207 | | - | |
1208 | | - | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
1209 | 1209 | | |
1210 | 1210 | | |
1211 | 1211 | | |
| |||
1216 | 1216 | | |
1217 | 1217 | | |
1218 | 1218 | | |
1219 | | - | |
1220 | 1219 | | |
1221 | 1220 | | |
1222 | 1221 | | |
| |||
1230 | 1229 | | |
1231 | 1230 | | |
1232 | 1231 | | |
1233 | | - | |
1234 | 1232 | | |
1235 | 1233 | | |
1236 | | - | |
1237 | | - | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
1238 | 1237 | | |
1239 | 1238 | | |
1240 | 1239 | | |
| |||
0 commit comments