feat(routes): expand account parity coverage

This commit is contained in:
2026-06-04 20:44:20 +08:00
parent 14fa51d0b6
commit 14e784c51d
7 changed files with 253 additions and 20 deletions
+65 -1
View File
@@ -29,6 +29,19 @@ var criticalRoutes = []route{
{Method: "POST", Path: "/api/v1/accounts/:account_id/update_active_at", Controller: "api/v1/accounts#update_active_at", Source: "routes.rb:49"},
{Method: "GET", Path: "/api/v1/accounts/:account_id/cache_keys", Controller: "api/v1/accounts#cache_keys", Source: "routes.rb:50"},
{Method: "GET", Path: "/api/v1/accounts/:account_id/agents", Controller: "api/v1/accounts/agents#index", Source: "routes.rb:59"},
{Method: "POST", Path: "/api/v1/accounts/:account_id/agents", Controller: "api/v1/accounts/agents#create", Source: "routes.rb:59"},
{Method: "PUT", Path: "/api/v1/accounts/:account_id/agents/:agent_id", Controller: "api/v1/accounts/agents#update", Source: "routes.rb:59"},
{Method: "DELETE", Path: "/api/v1/accounts/:account_id/agents/:agent_id", Controller: "api/v1/accounts/agents#destroy", Source: "routes.rb:59"},
{Method: "POST", Path: "/api/v1/accounts/:account_id/agents/bulk_create", Controller: "api/v1/accounts/agents#bulk_create", Source: "routes.rb:60"},
{Method: "GET", Path: "/api/v1/accounts/:account_id/assignable_agents", Controller: "api/v1/accounts/assignable_agents#index", Source: "routes.rb:104"},
{Method: "GET", Path: "/api/v1/accounts/:account_id/audit_logs/", Controller: "api/v1/accounts/audit_logs#show", Source: "routes.rb:105"},
{Method: "GET", Path: "/api/v1/accounts/:account_id/canned_responses/", Controller: "api/v1/accounts/canned_responses#index", Source: "routes.rb:114"},
{Method: "POST", Path: "/api/v1/accounts/:account_id/canned_responses/", Controller: "api/v1/accounts/canned_responses#create", Source: "routes.rb:114"},
{Method: "PUT", Path: "/api/v1/accounts/:account_id/canned_responses/:id", Controller: "api/v1/accounts/canned_responses#update", Source: "routes.rb:114"},
{Method: "DELETE", Path: "/api/v1/accounts/:account_id/canned_responses/:id", Controller: "api/v1/accounts/canned_responses#destroy", Source: "routes.rb:114"},
{Method: "GET", Path: "/api/v1/accounts/:account_id/conversations/", Controller: "api/v1/accounts/conversations#index", Source: "routes.rb:134"},
{Method: "POST", Path: "/api/v1/accounts/:account_id/conversations/", Controller: "api/v1/accounts/conversations#create", Source: "routes.rb:134"},
{Method: "GET", Path: "/api/v1/accounts/:account_id/conversations/:conversation_id", Controller: "api/v1/accounts/conversations#show", Source: "routes.rb:134"},
@@ -74,6 +87,8 @@ var criticalRoutes = []route{
{Method: "GET", Path: "/api/v1/accounts/:account_id/companies/:company_id/contacts", Controller: "api/v1/accounts/companies/contacts#index", Source: "routes.rb:188"},
{Method: "POST", Path: "/api/v1/accounts/:account_id/companies/:company_id/contacts/:contact_id", Controller: "api/v1/accounts/companies/contacts#create", Source: "routes.rb:188"},
{Method: "DELETE", Path: "/api/v1/accounts/:account_id/companies/:company_id/contacts/:contact_id", Controller: "api/v1/accounts/companies/contacts#destroy", Source: "routes.rb:188"},
{Method: "GET", Path: "/api/v1/accounts/:account_id/companies/:company_id/conversations", Controller: "api/v1/accounts/companies/conversations#index", Source: "routes.rb:193"},
{Method: "GET", Path: "/api/v1/accounts/:account_id/companies/:company_id/notes", Controller: "api/v1/accounts/companies/notes#index", Source: "routes.rb:194"},
{Method: "GET", Path: "/api/v1/accounts/:account_id/search", Controller: "api/v1/accounts/search#index", Source: "routes.rb:170"},
{Method: "GET", Path: "/api/v1/accounts/:account_id/search/conversations", Controller: "api/v1/accounts/search#conversations", Source: "routes.rb:173"},
@@ -88,8 +103,57 @@ var criticalRoutes = []route{
{Method: "DELETE", Path: "/api/v1/accounts/:account_id/inboxes/:inbox_id", Controller: "api/v1/accounts/inboxes#destroy", Source: "routes.rb:252"},
{Method: "GET", Path: "/api/v1/accounts/:account_id/inboxes/:inbox_id/assignable_agents", Controller: "api/v1/accounts/inboxes#assignable_agents", Source: "routes.rb:253"},
{Method: "GET", Path: "/api/v1/accounts/:account_id/inboxes/:inbox_id/campaigns", Controller: "api/v1/accounts/inboxes#campaigns", Source: "routes.rb:254"},
{Method: "GET", Path: "/api/v1/accounts/:account_id/inboxes/:inbox_id/agent_bot", Controller: "api/v1/accounts/inboxes#agent_bot", Source: "routes.rb:255"},
{Method: "POST", Path: "/api/v1/accounts/:account_id/inboxes/:inbox_id/set_agent_bot", Controller: "api/v1/accounts/inboxes#set_agent_bot", Source: "routes.rb:256"},
{Method: "DELETE", Path: "/api/v1/accounts/:account_id/inboxes/:inbox_id/avatar", Controller: "api/v1/accounts/inboxes#avatar", Source: "routes.rb:257"},
{Method: "POST", Path: "/api/v1/accounts/:account_id/inboxes/:inbox_id/sync_templates", Controller: "api/v1/accounts/inboxes#sync_templates", Source: "routes.rb:258"},
{Method: "GET", Path: "/api/v1/accounts/:account_id/inboxes/:inbox_id/health", Controller: "api/v1/accounts/inboxes#health", Source: "routes.rb:259"},
{Method: "POST", Path: "/api/v1/accounts/:account_id/inboxes/:inbox_id/register_webhook", Controller: "api/v1/accounts/inboxes#register_webhook", Source: "routes.rb:260"},
{Method: "POST", Path: "/api/v1/accounts/:account_id/inboxes/:inbox_id/reset_secret", Controller: "api/v1/accounts/inboxes#reset_secret", Source: "routes.rb:262"},
{Method: "POST", Path: "/api/v1/accounts/:account_id/inbox_members/", Controller: "api/v1/accounts/inbox_members#create", Source: "routes.rb:275"},
{Method: "GET", Path: "/api/v1/accounts/:account_id/inbox_members/:inbox_id", Controller: "api/v1/accounts/inbox_members#show", Source: "routes.rb:275"},
{Method: "PATCH", Path: "/api/v1/accounts/:account_id/inbox_members/", Controller: "api/v1/accounts/inbox_members#update", Source: "routes.rb:278"},
{Method: "DELETE", Path: "/api/v1/accounts/:account_id/inbox_members/", Controller: "api/v1/accounts/inbox_members#destroy", Source: "routes.rb:277"},
{Method: "GET", Path: "/api/v1/accounts/:account_id/labels/", Controller: "api/v1/accounts/labels#index", Source: "routes.rb:281"},
{Method: "POST", Path: "/api/v1/accounts/:account_id/labels/", Controller: "api/v1/accounts/labels#create", Source: "routes.rb:281"},
{Method: "GET", Path: "/api/v1/accounts/:account_id/labels/:tag_id", Controller: "api/v1/accounts/labels#show", Source: "routes.rb:281"},
{Method: "PUT", Path: "/api/v1/accounts/:account_id/labels/:tag_id", Controller: "api/v1/accounts/labels#update", Source: "routes.rb:281"},
{Method: "DELETE", Path: "/api/v1/accounts/:account_id/labels/:tag_id", Controller: "api/v1/accounts/labels#destroy", Source: "routes.rb:281"},
{Method: "GET", Path: "/api/v1/accounts/:account_id/notifications/", Controller: "api/v1/accounts/notifications#index", Source: "routes.rb:283"},
{Method: "PUT", Path: "/api/v1/accounts/:account_id/notifications/:notification_id", Controller: "api/v1/accounts/notifications#update", Source: "routes.rb:283"},
{Method: "DELETE", Path: "/api/v1/accounts/:account_id/notifications/:notification_id", Controller: "api/v1/accounts/notifications#destroy", Source: "routes.rb:283"},
{Method: "POST", Path: "/api/v1/accounts/:account_id/notifications/read_all", Controller: "api/v1/accounts/notifications#read_all", Source: "routes.rb:285"},
{Method: "GET", Path: "/api/v1/accounts/:account_id/notifications/unread_count", Controller: "api/v1/accounts/notifications#unread_count", Source: "routes.rb:286"},
{Method: "POST", Path: "/api/v1/accounts/:account_id/notifications/destroy_all", Controller: "api/v1/accounts/notifications#destroy_all", Source: "routes.rb:287"},
{Method: "POST", Path: "/api/v1/accounts/:account_id/notifications/:notification_id/snooze", Controller: "api/v1/accounts/notifications#snooze", Source: "routes.rb:290"},
{Method: "POST", Path: "/api/v1/accounts/:account_id/notifications/:notification_id/unread", Controller: "api/v1/accounts/notifications#unread", Source: "routes.rb:291"},
{Method: "GET", Path: "/api/v1/accounts/:account_id/notification_settings/", Controller: "api/v1/accounts/notification_settings#show", Source: "routes.rb:293"},
{Method: "PUT", Path: "/api/v1/accounts/:account_id/notification_settings/", Controller: "api/v1/accounts/notification_settings#update", Source: "routes.rb:293"},
{Method: "GET", Path: "/api/v1/accounts/:account_id/teams/", Controller: "api/v1/accounts/teams#index", Source: "routes.rb:296"},
{Method: "POST", Path: "/api/v1/accounts/:account_id/teams/", Controller: "api/v1/accounts/teams#create", Source: "routes.rb:296"},
{Method: "GET", Path: "/api/v1/accounts/:account_id/teams/:team_id", Controller: "api/v1/accounts/teams#show", Source: "routes.rb:296"},
{Method: "PUT", Path: "/api/v1/accounts/:account_id/teams/:team_id", Controller: "api/v1/accounts/teams#update", Source: "routes.rb:296"},
{Method: "DELETE", Path: "/api/v1/accounts/:account_id/teams/:team_id", Controller: "api/v1/accounts/teams#destroy", Source: "routes.rb:296"},
{Method: "GET", Path: "/api/v1/accounts/:account_id/teams/:team_id/team_members/", Controller: "api/v1/accounts/teams/team_members#index", Source: "routes.rb:297"},
{Method: "POST", Path: "/api/v1/accounts/:account_id/teams/:team_id/team_members/", Controller: "api/v1/accounts/teams/team_members#create", Source: "routes.rb:297"},
{Method: "PATCH", Path: "/api/v1/accounts/:account_id/teams/:team_id/team_members/", Controller: "api/v1/accounts/teams/team_members#update", Source: "routes.rb:300"},
{Method: "DELETE", Path: "/api/v1/accounts/:account_id/teams/:team_id/team_members/", Controller: "api/v1/accounts/teams/team_members#destroy", Source: "routes.rb:299"},
{Method: "GET", Path: "/api/v1/accounts/:account_id/custom_attribute_definitions/", Controller: "api/v1/accounts/custom_attribute_definitions#index", Source: "routes.rb:250"},
{Method: "POST", Path: "/api/v1/accounts/:account_id/custom_attribute_definitions/", Controller: "api/v1/accounts/custom_attribute_definitions#create", Source: "routes.rb:250"},
{Method: "GET", Path: "/api/v1/accounts/:account_id/custom_attribute_definitions/:id", Controller: "api/v1/accounts/custom_attribute_definitions#show", Source: "routes.rb:250"},
{Method: "PUT", Path: "/api/v1/accounts/:account_id/custom_attribute_definitions/:id", Controller: "api/v1/accounts/custom_attribute_definitions#update", Source: "routes.rb:250"},
{Method: "DELETE", Path: "/api/v1/accounts/:account_id/custom_attribute_definitions/:id", Controller: "api/v1/accounts/custom_attribute_definitions#destroy", Source: "routes.rb:250"},
{Method: "GET", Path: "/api/v1/accounts/:account_id/custom_filters/", Controller: "api/v1/accounts/custom_filters#index", Source: "routes.rb:251"},
{Method: "POST", Path: "/api/v1/accounts/:account_id/custom_filters/", Controller: "api/v1/accounts/custom_filters#create", Source: "routes.rb:251"},
{Method: "GET", Path: "/api/v1/accounts/:account_id/custom_filters/:id", Controller: "api/v1/accounts/custom_filters#show", Source: "routes.rb:251"},
{Method: "PUT", Path: "/api/v1/accounts/:account_id/custom_filters/:id", Controller: "api/v1/accounts/custom_filters#update", Source: "routes.rb:251"},
{Method: "DELETE", Path: "/api/v1/accounts/:account_id/custom_filters/:id", Controller: "api/v1/accounts/custom_filters#destroy", Source: "routes.rb:251"},
{Method: "GET", Path: "/api/v1/accounts/:account_id/automation_rules/", Controller: "api/v1/accounts/automation_rules#index", Source: "routes.rb:115"},
{Method: "POST", Path: "/api/v1/accounts/:account_id/automation_rules/", Controller: "api/v1/accounts/automation_rules#create", Source: "routes.rb:115"},
{Method: "GET", Path: "/api/v1/accounts/:account_id/automation_rules/:automation_id", Controller: "api/v1/accounts/automation_rules#show", Source: "routes.rb:115"},
@@ -220,7 +284,7 @@ func writeParity(path string, gochatPath string, chatwootPath string, gochatRout
b.WriteString("Generated from:\n\n")
b.WriteString("- GoChat route dump: `" + gochatPath + "`\n")
b.WriteString("- Chatwoot route source: `" + chatwootPath + "`\n\n")
b.WriteString("This first report covers frontend-critical API v1 account routes from `reference/chatwoot/config/routes.rb`. Ruby is not installed in the workspace, so Chatwoot routes are sourced from static route declarations instead of `bin/rails routes`.\n\n")
b.WriteString("This report covers tracked frontend-critical API v1 account routes from `reference/chatwoot/config/routes.rb`. Ruby is not installed in the workspace, so Chatwoot routes are sourced from static route declarations instead of `bin/rails routes`.\n\n")
b.WriteString(fmt.Sprintf("Summary: %d exact, %d method-compatible, %d parameter-compatible, %d missing out of %d tracked critical routes.\n\n", len(exact), len(methodCompatible), len(compatible), len(missing), len(criticalRoutes)))
b.WriteString("## Missing Critical Routes\n\n")