From b17b6c76fb6939c14756e54cb9b6a12338ee4698 Mon Sep 17 00:00:00 2001 From: shanu Date: Mon, 21 Sep 2026 17:19:15 +0530 Subject: [PATCH] feat(opencompany): add companies catalog route to the contract Sync the public route registry and manifest against backend main: - add GET /opencompany/companies, the company-template catalog the dashboard and landing read to let users pick a company on create - restore POST /opencompany/instances/{slug}/update, which a prior bare resync against the deployed spec had dropped from PUBLIC_ROUTES - operationCount 206 -> 208; update the pinned counts in openapi_sync --- api/tinyhumans.backend.json | 10 ++++++---- src/generated_public_routes.rs | 2 ++ tests/openapi_sync.rs | 11 +++++++++-- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/api/tinyhumans.backend.json b/api/tinyhumans.backend.json index ddb280c..c33b0eb 100644 --- a/api/tinyhumans.backend.json +++ b/api/tinyhumans.backend.json @@ -8,9 +8,9 @@ "url": "https://api.tinyhumans.ai/swagger.json", "title": "TinyHumans API", "version": "1.0.0", - "pathCount": 235, - "totalOperationCount": 260, - "operationCount": 206, + "pathCount": 237, + "totalOperationCount": 262, + "operationCount": 208, "supplementalOperationCount": 13, "excludedAdminOperationCount": 46, "excludedWebhookOperationCount": 12, @@ -312,19 +312,21 @@ "name": "openCompany", "basePath": "/opencompany", "auth": "bearer", - "operationCount": 9, + "operationCount": 11, "tags": [ "OpenCompany" ], "routes": [ "DELETE /opencompany/instances/{slug}", "DELETE /opencompany/instances/{slug}/custom-domain", + "GET /opencompany/companies", "GET /opencompany/instances", "GET /opencompany/instances/usage", "POST /opencompany/instances", "POST /opencompany/instances/{slug}/custom-domain/verify", "POST /opencompany/instances/{slug}/resume", "POST /opencompany/instances/{slug}/suspend", + "POST /opencompany/instances/{slug}/update", "PUT /opencompany/instances/{slug}/custom-domain" ] }, diff --git a/src/generated_public_routes.rs b/src/generated_public_routes.rs index 3be152b..197a223 100644 --- a/src/generated_public_routes.rs +++ b/src/generated_public_routes.rs @@ -136,6 +136,7 @@ pub const PUBLIC_ROUTES: &[(&str, &str)] = &[ ("POST", "/openai/v1/completions"), ("POST", "/openai/v1/embeddings"), ("GET", "/openai/v1/models"), + ("GET", "/opencompany/companies"), ("GET", "/opencompany/instances"), ("POST", "/opencompany/instances"), ("DELETE", "/opencompany/instances/{slug}"), @@ -144,6 +145,7 @@ pub const PUBLIC_ROUTES: &[(&str, &str)] = &[ ("POST", "/opencompany/instances/{slug}/custom-domain/verify"), ("POST", "/opencompany/instances/{slug}/resume"), ("POST", "/opencompany/instances/{slug}/suspend"), + ("POST", "/opencompany/instances/{slug}/update"), ("GET", "/opencompany/instances/usage"), ("POST", "/payments/coinbase/charge"), ("GET", "/payments/coinbase/charge/{gatewayTransactionId}"), diff --git a/tests/openapi_sync.rs b/tests/openapi_sync.rs index b0990cb..1d2e5f3 100644 --- a/tests/openapi_sync.rs +++ b/tests/openapi_sync.rs @@ -159,7 +159,12 @@ fn generated_rust_routes_match_the_public_manifest() { // 203 -> 204: `POST /opencompany/instances/{slug}/update`, the // owner-triggered "update to latest" for a hosted company. // 204 -> 206: OpenRouter System One plus its TypeSafe-compatible alias. - assert_eq!(manifest["source"]["operationCount"], 206); + // 206 -> 208: `GET /opencompany/companies`, the company-template catalog, + // and `POST /opencompany/instances/{slug}/update`, the owner-triggered + // "update to latest" — both are served by the backend `main` this syncs + // against (sdk main had been generated from the deployed spec that predated + // them). + assert_eq!(manifest["source"]["operationCount"], 208); // 14 -> 13: `GET /orchestration/v1/steering` left with that family. assert_eq!(manifest["source"]["supplementalOperationCount"], 13); // 37 -> 39: the two service-token operations on @@ -188,7 +193,9 @@ fn generated_rust_routes_match_the_public_manifest() { // user-facing half of that flow is `POST /auth/guild/link-token`. assert_eq!(manifest["source"]["excludedAdminOperationCount"], 46); assert_eq!(manifest["source"]["excludedWebhookOperationCount"], 12); - assert_eq!(rust_routes.len(), 206); + // 206 -> 208: the two new public opencompany routes above + // (`GET /opencompany/companies` and `POST /opencompany/instances/{slug}/update`). + assert_eq!(rust_routes.len(), 208); assert_eq!(rust_routes, manifest_routes); assert!(rust_routes .iter()