| 1 | import type { FlaskBaseResponse } from "@/types/flask.d" |
| 2 | import type { Organization } from "@/types/shuffle.d" |
| 3 | import { HttpClient } from "../httpClient" |
| 4 | |
| 5 | export interface ShuffleConnectorCredentials { |
| 6 | base_url: string |
| 7 | api_key: string |
| 8 | } |
| 9 | |
| 10 | export default { |
| 11 | getOrganizations() { |
| 12 | return HttpClient.get<FlaskBaseResponse & { data: Organization[]; total_count: number }>( |
| 13 | `/shuffle/organizations/organizations?connector_name=Shuffle` |
| 14 | ) |
| 15 | }, |
| 16 | getOrganization(organizationId: string) { |
| 17 | return HttpClient.get<FlaskBaseResponse & { data: Organization }>( |
| 18 | `/shuffle/organizations/organizations/${organizationId}?connector_name=Shuffle` |
| 19 | ) |
| 20 | }, |
| 21 | // Returns the deployment-wide Shuffle connector base URL + API key for |
| 22 | // the React MCP embeds. Backed by the connectors table. |
| 23 | getConnectorCredentials() { |
| 24 | return HttpClient.get<FlaskBaseResponse & ShuffleConnectorCredentials>(`/shuffle/integrations/credentials`) |
| 25 | } |
| 26 | } |