Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 20 additions & 6 deletions api/tinyhumans.backend.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
"url": "https://api.tinyhumans.ai/swagger.json",
"title": "TinyHumans API",
"version": "1.0.0",
"pathCount": 228,
"totalOperationCount": 259,
"operationCount": 215,
"pathCount": 231,
"totalOperationCount": 263,
"operationCount": 218,
"supplementalOperationCount": 14,
"excludedAdminOperationCount": 37,
"excludedAdminOperationCount": 38,
"excludedWebhookOperationCount": 12,
"servers": [
"https://api.tinyhumans.ai/",
Expand Down Expand Up @@ -119,15 +119,16 @@
"name": "apiKeys",
"basePath": "/api-keys",
"auth": "bearer",
"operationCount": 4,
"operationCount": 5,
"tags": [
"API Keys"
],
"routes": [
"DELETE /api-keys/{keyId}",
"GET /api-keys",
"POST /api-keys",
"PUT /api-keys/{keyId}/spend-caps"
"PUT /api-keys/{keyId}/spend-caps",
"PUT /api-keys/{keyId}/spend-policy"
]
},
{
Expand Down Expand Up @@ -436,6 +437,19 @@
"PUT /spend-caps"
]
},
{
"name": "spendPolicy",
"basePath": "/spend-policy",
"auth": "bearer",
"operationCount": 2,
"tags": [
"Spend Policy"
],
"routes": [
"GET /spend-policy",
"PUT /spend-policy"
]
},
{
"name": "teams",
"basePath": "/teams",
Expand Down
4 changes: 4 additions & 0 deletions src/generated_public_routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ pub const PUBLIC_ROUTES: &[(&str, &str)] = &[
("POST", "/api-keys"),
("DELETE", "/api-keys/{keyId}"),
("PUT", "/api-keys/{keyId}/spend-caps"),
("PUT", "/api-keys/{keyId}/spend-policy"),
("GET", "/auth/{provider}/callback"),
("GET", "/auth/{provider}/connect"),
("GET", "/auth/{provider}/login"),
Expand Down Expand Up @@ -185,6 +186,8 @@ pub const PUBLIC_ROUTES: &[(&str, &str)] = &[
("GET", "/rewards/me"),
("GET", "/spend-caps"),
("PUT", "/spend-caps"),
("GET", "/spend-policy"),
("PUT", "/spend-policy"),
("GET", "/teams"),
("GET", "/teams/{teamId}"),
("PUT", "/teams/{teamId}"),
Expand Down Expand Up @@ -239,6 +242,7 @@ pub(crate) const UNEXPOSED_ROUTES: &[(&str, &str)] = &[
("POST", "/admin/users/{userId}/credits"),
("PATCH", "/admin/users/{userId}/medulla-access"),
("PATCH", "/admin/users/{userId}/spend-caps"),
("PATCH", "/admin/users/{userId}/spend-policy"),
("DELETE", "/admin/users/{userId}/subscription"),
("POST", "/admin/users/{userId}/subscription"),
("POST", "/admin/users/credits/bulk"),
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ mod exclusion_tests {
// Pinned so the list can only ever be reviewed upward. A regenerated
// spec that stopped describing admin or webhook routes would otherwise
// shrink this list and silently unblock them at the raw transport.
assert_eq!(UNEXPOSED_ROUTES.len(), 49);
assert_eq!(UNEXPOSED_ROUTES.len(), 50);
for (method, template) in UNEXPOSED_ROUTES {
let concrete_path = template
.split('/')
Expand Down
6 changes: 3 additions & 3 deletions tests/openapi_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,11 @@ fn generated_rust_routes_match_the_public_manifest() {
.collect::<BTreeSet<_>>();
let rust_routes = PUBLIC_ROUTES.iter().copied().collect::<BTreeSet<_>>();

assert_eq!(manifest["source"]["operationCount"], 215);
assert_eq!(manifest["source"]["operationCount"], 218);
assert_eq!(manifest["source"]["supplementalOperationCount"], 14);
assert_eq!(manifest["source"]["excludedAdminOperationCount"], 37);
assert_eq!(manifest["source"]["excludedAdminOperationCount"], 38);
assert_eq!(manifest["source"]["excludedWebhookOperationCount"], 12);
assert_eq!(rust_routes.len(), 215);
assert_eq!(rust_routes.len(), 218);
assert_eq!(rust_routes, manifest_routes);
assert!(rust_routes
.iter()
Expand Down
Loading