MCPcopy Index your code
hub / github.com/simstudioai/sim / firefliesGraphQL

Function firefliesGraphQL

apps/sim/connectors/fireflies/fireflies.ts:35–66  ·  view source on GitHub ↗

* Executes a GraphQL query against the Fireflies API.

(
  accessToken: string,
  query: string,
  variables: Record<string, unknown> = {},
  retryOptions?: Parameters<typeof fetchWithRetry>[2]
)

Source from the content-addressed store, hash-verified

33 * Executes a GraphQL query against the Fireflies API.
34 */
35async function firefliesGraphQL(
36 accessToken: string,
37 query: string,
38 variables: Record<string, unknown> = {},
39 retryOptions?: Parameters<typeof fetchWithRetry>[2]
40): Promise<Record<string, unknown>> {
41 const response = await fetchWithRetry(
42 FIREFLIES_GRAPHQL_URL,
43 {
44 method: 'POST',
45 headers: {
46 'Content-Type': 'application/json',
47 Authorization: `Bearer ${accessToken}`,
48 },
49 body: JSON.stringify({ query, variables }),
50 },
51 retryOptions
52 )
53
54 if (!response.ok) {
55 throw new Error(`Fireflies API HTTP error: ${response.status}`)
56 }
57
58 const data = await response.json()
59
60 if (data.errors) {
61 const message = (data.errors as { message: string }[])[0]?.message || 'Unknown GraphQL error'
62 throw new Error(`Fireflies API error: ${message}`)
63 }
64
65 return data.data as Record<string, unknown>
66}
67
68/**
69 * Formats transcript sentences into plain text content.

Callers 1

fireflies.tsFile · 0.85

Calls 1

fetchWithRetryFunction · 0.90

Tested by

no test coverage detected