MCPcopy Index your code
hub / github.com/Linen-dev/linen.dev / fetchTeams

Function fetchTeams

packages/integration-linear/src/helpers/linear.ts:17–41  ·  view source on GitHub ↗
({
  linearClient,
  accessToken,
}: {
  linearClient?: LinearClient;
  accessToken?: string;
})

Source from the content-addressed store, hash-verified

15}
16
17export async function fetchTeams({
18 linearClient,
19 accessToken,
20}: {
21 linearClient?: LinearClient;
22 accessToken?: string;
23}) {
24 if (!linearClient) {
25 linearClient = new LinearClient({ accessToken });
26 }
27
28 const teams = [];
29
30 let response = await linearClient.teams();
31 teams.push(...response.nodes.map(parseTeam));
32
33 let hasMore = response.pageInfo.hasNextPage;
34 while (hasMore) {
35 response = await linearClient.teams({ after: response.pageInfo.endCursor });
36 teams.push(...response.nodes.map(parseTeam));
37 hasMore = response.pageInfo.hasNextPage;
38 }
39
40 return teams;
41}
42
43type createMessageType = {
44 accessToken: string;

Callers 1

inbound.tsFile · 0.90

Calls 1

mapMethod · 0.80

Tested by

no test coverage detected