MCPcopy Create free account
hub / github.com/simstudioai/sim / resolveBoardIds

Function resolveBoardIds

apps/sim/connectors/monday/monday.ts:300–328  ·  view source on GitHub ↗

* Fetches the list of board ids the connector should sync. When `boardIds` is * configured, those are used verbatim; otherwise all accessible active boards * are enumerated.

(
  accessToken: string,
  sourceConfig: Record<string, unknown>
)

Source from the content-addressed store, hash-verified

298 * are enumerated.
299 */
300async function resolveBoardIds(
301 accessToken: string,
302 sourceConfig: Record<string, unknown>
303): Promise<{ id: string; name: string | null }[]> {
304 const configured = parseMultiValue(sourceConfig.boardIds)
305 if (configured.length > 0) {
306 return configured.map((id) => ({ id, name: null }))
307 }
308
309 const boards: { id: string; name: string | null }[] = []
310 let page = 1
311 for (;;) {
312 const data = await mondayGraphQL<{ boards: { id: string; name: string | null }[] | null }>(
313 accessToken,
314 `query ($limit: Int!, $page: Int!) {
315 boards(limit: $limit, page: $page, state: active) {
316 id
317 name
318 }
319 }`,
320 { limit: BOARDS_PAGE_SIZE, page }
321 )
322 const batch = data.boards ?? []
323 boards.push(...batch)
324 if (batch.length < BOARDS_PAGE_SIZE) break
325 page += 1
326 }
327 return boards
328}
329
330export const mondayConnector: ConnectorConfig = {
331 ...mondayConnectorMeta,

Callers 1

monday.tsFile · 0.85

Calls 2

parseMultiValueFunction · 0.90
pushMethod · 0.45

Tested by

no test coverage detected