* Sync group templates from code to database
()
| 173 | * Sync group templates from code to database |
| 174 | */ |
| 175 | async syncTemplates(): Promise<{ |
| 176 | syncedCount: number; |
| 177 | createdCount: number; |
| 178 | updatedCount: number; |
| 179 | templates: string[]; |
| 180 | }> { |
| 181 | const headers = await getApiAuthHeaders(); |
| 182 | const response = await fetch(`${API_BASE_URL}/api/v1/mcp-groups/sync-templates`, { |
| 183 | method: 'POST', |
| 184 | headers, |
| 185 | }); |
| 186 | |
| 187 | if (!response.ok) { |
| 188 | const error = await response |
| 189 | .json() |
| 190 | .catch(() => ({ message: 'Failed to sync group templates' })); |
| 191 | throw new Error(error.message || 'Failed to sync group templates'); |
| 192 | } |
| 193 | |
| 194 | return response.json(); |
| 195 | }, |
| 196 | |
| 197 | /** |
| 198 | * Import a specific group template |
nothing calls this directly
no test coverage detected